Class CondLengthProperty

java.lang.Object
org.apache.fop.fo.properties.Property
org.apache.fop.fo.properties.CondLengthProperty
All Implemented Interfaces:
CompoundDatatype, Constants

public class CondLengthProperty extends Property implements CompoundDatatype
Superclass for properties that have conditional lengths
  • Constructor Details

    • CondLengthProperty

      public CondLengthProperty()
  • Method Details

    • setComponent

      public void setComponent(int cmpId, Property cmpnValue, boolean bIsDefault)
      Sets a component of the compound datatype.
      Specified by:
      setComponent in interface CompoundDatatype
      Parameters:
      cmpId - ID of the component
      cmpnValue - value of the component
      bIsDefault - Indicates if it's the default value
    • getComponent

      public Property getComponent(int cmpId)
      Returns a component of the compound datatype.
      Specified by:
      getComponent in interface CompoundDatatype
      Parameters:
      cmpId - ID of the component
      Returns:
      the value of the component
    • getConditionality

      public Property getConditionality()
      Returns the conditionality.
      Returns:
      the conditionality
    • getLengthComponent

      public Property getLengthComponent()
      Returns the length.
      Returns:
      the length
    • isDiscard

      public boolean isDiscard()
      Indicates if the length can be discarded on certain conditions.
      Returns:
      true if the length can be discarded.
    • getLengthValue

      public int getLengthValue()
      Returns the computed length value.
      Returns:
      the length in millipoints
    • getLengthValue

      public int getLengthValue(PercentBaseContext context)
      Returns the computed length value.
      Parameters:
      context - The context for the length calculation (for percentage based lengths)
      Returns:
      the length in millipoints
    • toString

      public String toString()
      Overrides:
      toString in class Property
    • getCondLength

      public CondLengthProperty getCondLength()
      Description copied from class: Property
      This method expects to be overridden by subclasses
      Overrides:
      getCondLength in class Property
      Returns:
      this.condLength
    • getLength

      public Length getLength()
      TODO: Should we allow this?
      Overrides:
      getLength in class Property
      Returns:
      this.condLength cast as a Length
    • getObject

      public Object getObject()
      Description copied from class: Property
      This method expects to be overridden by subclasses
      Overrides:
      getObject in class Property
      Returns:
      this.condLength cast as an Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object