Package com.snowtide.pdf.layout
Interface Block
- 
- All Superinterfaces:
 BlockParent,Bounded,OutputSource
- All Known Subinterfaces:
 Table
public interface Block extends Bounded, BlockParent, OutputSource
Instances of this class represent groupings of text at a specific position on aPage.Blocks can contain
Linesand/or other Blocks (via theBlockParentinterface). Existing implementations generally will not allow a Block to contain both Blocks and Lines.- Version:
 - ©2004-2025 Snowtide
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Blockcrop(Region area)Returns aBlockthat contains only the content held by thisBlockthat intersects the given "query" area.LinegetLine(int idx)Returns theLineat the given index.intgetLineCnt()Returns the number ofLines held by this Block.List<? extends Line>getLines()Returns a List view of theLines held by this Block.DirectionguessDirection()Returns theDirectionof this block (in aggregate of all of its lines and child blocks, if any), determined via a heuristic that surveys all included text content.LineremoveLine(int idx)Removes theLineat the given index from this Block, and returns it.- 
Methods inherited from interface com.snowtide.pdf.layout.BlockParent
addChild, getChild, getChildCnt, removeAllChildren, removeChild, replaceChild, sortChildren 
- 
Methods inherited from interface com.snowtide.pdf.OutputSource
pipe, pipe 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getLines
List<? extends Line> getLines()
Returns a List view of theLines held by this Block. The returned List is guaranteed to offer efficient random access.- Since:
 - v1.4
 
 
- 
getLineCnt
int getLineCnt()
Returns the number ofLines held by this Block.- Since:
 - v1.4
 
 
- 
removeLine
Line removeLine(int idx)
Removes the
Lineat the given index from this Block, and returns it.- Since:
 - v1.4
 
 
- 
crop
Block crop(Region area)
Returns aBlockthat contains only the content held by thisBlockthat intersects the given "query" area. If all of the content held by this instance is intersected by the query area, then this instance may be returned unchanged. If no content in thisBlockintersects the query area, then an emptyBlockwill be returned. 
- 
guessDirection
Direction guessDirection()
Returns theDirectionof this block (in aggregate of all of its lines and child blocks, if any), determined via a heuristic that surveys all included text content. This value is what determines the default base direction used when invokingOutputSource.pipe(OutputHandler).- Since:
 - v4.0
 
 
 - 
 
 -