Class Keep


  • public final class Keep
    extends java.lang.Object
    Object representing a keep constraint, corresponding to the XSL-FO keep properties.
    • Field Detail

      • KEEP_AUTO

        public static final Keep KEEP_AUTO
        keep auto
      • KEEP_ALWAYS

        public static final Keep KEEP_ALWAYS
        keep always
    • Method Detail

      • getKeep

        public static Keep getKeep​(KeepProperty keepProperty)
        Obtain a Keep instance corresponding to the given KeepProperty
        Parameters:
        keepProperty - the KeepProperty
        Returns:
        a new instance corresponding to the given property
      • isAuto

        public boolean isAuto()
        Returns:
        true if the keep property was specified as "auto"
      • getPenalty

        public int getPenalty()
        Returns:
        the penalty value corresponding to the strength of this Keep
      • compare

        public Keep compare​(Keep other)
        Compare this Keep instance to another one, and return the stronger one if the context is the same
        Parameters:
        other - the instance to compare to
        Returns:
        the winning Keep instance
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object