Class Sheet

  • All Implemented Interfaces:
    SplitPointUnit

    public class Sheet
    extends Object
    implements SplitPointUnit

    Provides a sheet data type. A sheet represents a physical paper and just like a physical sheet, it can hold one or two pages.

    Sheet is the unit used when calculating volume breaks. For this reason, Sheet implements SplitPointUnit. The last sheet of the volume may be modified after the volume break has been calculated.

    • Method Detail

      • isBreakable

        public boolean isBreakable()
        Description copied from interface: SplitPointUnit
        Returns true if this unit is allowed to be the last unit in a result.
        Specified by:
        isBreakable in interface SplitPointUnit
        Returns:
        returns true if the unit is breakable, false otherwise
      • isSkippable

        public boolean isSkippable()
        Description copied from interface: SplitPointUnit
        Returns true if this unit is skippable if it overflows the result.
        Specified by:
        isSkippable in interface SplitPointUnit
        Returns:
        returns true if the unit is skippable, false otherwise
      • isCollapsible

        public boolean isCollapsible()
        Description copied from interface: SplitPointUnit
        Returns true if this unit can be excluded if an adjoining object collapsesWith this unit, but has a greater size.
        Specified by:
        isCollapsible in interface SplitPointUnit
        Returns:
        true if the unit is collapsible, false otherwise
      • getUnitSize

        public float getUnitSize()
        Description copied from interface: SplitPointUnit
        Gets the size of the unit.
        Specified by:
        getUnitSize in interface SplitPointUnit
        Returns:
        returns the size of the unit
      • getLastUnitSize

        public float getLastUnitSize()
        Description copied from interface: SplitPointUnit
        Gets the size of the unit if it is the last unit.
        Specified by:
        getLastUnitSize in interface SplitPointUnit
        Returns:
        returns the size of the unit when placed last in the result.
      • getAvoidVolumeBreakAfterPriority

        public VolumeKeepPriority getAvoidVolumeBreakAfterPriority()
      • collapsesWith

        public boolean collapsesWith​(Object obj)
        Description copied from interface: SplitPointUnit
        Returns true if this unit can collapse with the other object.
        Specified by:
        collapsesWith in interface SplitPointUnit
        Parameters:
        obj - the other object
        Returns:
        true if the objects can collapse, false otherwise
      • countPages

        public static int countPages​(List<Sheet> sheets)
        Counts the number of pages.
        Parameters:
        sheets - the list of sheets to count
        Returns:
        returns the number of pages