Package com.teamten.typeset
Class Chunk
java.lang.Object
com.teamten.typeset.Chunk
Represents a sequence of elements being considered for fitting into a space, either horizontally
into a line or vertically into a page.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Functional interface for getting the size of an element. -
Method Summary
Modifier and TypeMethodDescriptionlong
Given what we found about this line or page, compute the badness, which basically tells us how much we had to stretch or shrink.static Chunk
create
(List<Element> elements, long maxSize, long actualSize, boolean extractImagesAndFootnotes, boolean placeFootnotes, Chunk.ElementSizer elementSizer) Create a new Chunk object given a list of elements and a size they must fit into.fixed()
Returns a copy of the element list but with the flexible element fixed so that all the elements will fit properly in the size that was specified when this object was created.long
The list of footnotes that were extracted from the original list of elements.The list of images that were extracted from the original list of elements.double
getRatio()
long
getSize()
boolean
-
Method Details
-
getImages
The list of images that were extracted from the original list of elements. If there were none, this returns an empty list. -
getFootnotes
The list of footnotes that were extracted from the original list of elements. If there were none, this returns an empty list. -
getExtraSpace
public long getExtraSpace() -
getSize
public long getSize() -
getRatio
public double getRatio() -
isOverfull
public boolean isOverfull() -
create
public static Chunk create(List<Element> elements, long maxSize, long actualSize, boolean extractImagesAndFootnotes, boolean placeFootnotes, Chunk.ElementSizer elementSizer) Create a new Chunk object given a list of elements and a size they must fit into.- Parameters:
actualSize
- the total size of the elements. Use -1 to have this method compute it.extractImagesAndFootnotes
- whether to pull images and footnotes into the separateimages
andfootnotes
properties.elementSizer
- returns the size of an element.
-
computeBadness
public long computeBadness()Given what we found about this line or page, compute the badness, which basically tells us how much we had to stretch or shrink. -
fixed
Returns a copy of the element list but with the flexible element fixed so that all the elements will fit properly in the size that was specified when this object was created.
-