Class FixedLength

All Implemented Interfaces:
Length, Numeric

public final class FixedLength extends LengthProperty
An absolute length quantity in XSL
  • Field Details

  • Method Details

    • getInstance

      public static FixedLength getInstance(double numUnits, String units, float sourceResolution)
      Return the cached FixedLength instance corresponding to the computed value in base-units (millipoints).
      Parameters:
      numUnits - quantity of input units
      units - input unit specifier
      sourceResolution - input/source resolution (= ratio of pixels per pt)
      Returns:
      the canonical FixedLength instance corresponding to the given number of units and unit specifier in the given resolution
    • getInstance

      public static FixedLength getInstance(double numUnits, String units)
      Return the cached FixedLength instance corresponding to the computed value This method assumes a source-resolution of 1 (1px = 1pt)
      Parameters:
      numUnits - input units
      units - unit specifier
      Returns:
      the canonical FixedLength instance corresponding to the given number of units and unit specifier
    • getInstance

      public static FixedLength getInstance(double numUnits)
      Return the cached FixedLength instance corresponding to the computed value. This method assumes 'millipoints' (non-standard) as units, and an implied source-resolution of 1 (1px = 1pt).
      Parameters:
      numUnits - input units
      Returns:
      the canonical FixedLength instance corresponding to the given number of units and unit specifier
    • getValue

      public int getValue()
      Returns the length in 1/1000ths of a point (millipoints)
      Returns:
      the length in millipoints
    • getValue

      public int getValue(PercentBaseContext context)
      Returns the length in 1/1000ths of a point (millipoints)
      Parameters:
      context - The context for the length calculation (for percentage based lengths)
      Returns:
      the length in millipoints
    • getNumericValue

      public double getNumericValue()
      Return the value of this Numeric
      Returns:
      the computed value.
    • getNumericValue

      public double getNumericValue(PercentBaseContext context)
      Return the value of this Numeric
      Parameters:
      context - The context for the length calculation (for percentage based lengths)
      Returns:
      the computed value.
    • isAbsolute

      public boolean isAbsolute()
      Return true since a FixedLength is always absolute. Return true if the numeric is an absolute value. Relative values are percentages and table-column-units. All other numerics are absolute.
      Returns:
      true when the numeric is absolute.
    • toString

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object