Package com.adobe.xfa

Class Measurement

java.lang.Object
com.adobe.xfa.Attribute
com.adobe.xfa.Measurement

public final class Measurement extends Attribute
Measurement class. Used for all attributes that are expressed as an ordinate, such as X, Y, H, W, MinX.
  • Constructor Details

    • Measurement

      public Measurement(String qName, String value)
      Fully qualified constructor.
      Parameters:
      qName -
      value -
    • Measurement

      public Measurement(Attribute attr)
      Create a Measurement from an attribute.
      Parameters:
      attr - the attribute to create the measurement from.
    • Measurement

      public Measurement(UnitSpan unit)
      Create an Measurement from a UnitSpan.
      Parameters:
      unit - the UnitSpan to create the measurement from.
  • Method Details

    • getUnits

      public int getUnits()
      Get the internal value as an enum. The returned enum can be used to get a string representation of the units.
      Returns:
      The enumerated units value (EnumAttr.XFAUnitEnum)
    • getUnitSpan

      public UnitSpan getUnitSpan()
      Get the internal value as a UnitSpan
      Returns:
      the internal value as UnitSpan
    • getValue

      public double getValue()
      Get the internal value as a double
      Returns:
      the internal value as a double
    • getValueAsUnit

      public double getValueAsUnit(int units)
      Get the internal value converted to specific units defined in XFAUnitEnum
      Parameters:
      units - the units the value will be converted to (EnumAttr.XFAUnitEnum)
      Returns:
      the internal value converted to the given units
    • getValueAsUnit

      public static double getValueAsUnit(UnitSpan oSpan, int units)
      Get the value of the provided UnitSpan, converted to specific units defined in XFAUnitEnum. This is a static function.
      Parameters:
      oSpan - - the UnitSpan whose value should be converted
      units - - the units the value will be converted to (XFAEnum::XFAUnitEnum)
      Returns:
      the internal value converted to the given units
    • newAttribute

      public Attribute newAttribute(String value)
      Description copied from class: Attribute
      Create a new attribute, given a new value
      Specified by:
      newAttribute in class Attribute
      Parameters:
      value - the string to use to create the new attribute
      Returns:
      a new attribute
    • newAttribute

      public Attribute newAttribute(String NS, String localName, String qName, String value)
      Description copied from class: Attribute
      Create a new attribute, given all attribute parameters
      Specified by:
      newAttribute in class Attribute
      Parameters:
      NS - the namespace for this attribute
      localName - the local name for this attribute
      qName - the qualified name for this attribute
      value - the string to use to create the new attribute
      Returns:
      a new attribute
    • newAttribute

      public Attribute newAttribute(String NS, String localName, String qName, String value, boolean internSymbols)
      Description copied from class: Attribute
      Create a new attribute, given all attribute parameters
      Specified by:
      newAttribute in class Attribute
      Parameters:
      NS - the namespace for this attribute
      localName - the local name for this attribute
      qName - the qualified name for this attribute
      value - the string to use to create the new attribute
      internSymbols - indicates whether the symbols in other parameters need to be interned.
      Returns:
      a new attribute
    • normalize

      public void normalize()
      Description copied from class: Attribute
      Normalizes this attribute. This base class implementation simply does nothing, other than allow derived classes the opportunity to do something.
      Overrides:
      normalize in class Attribute
    • toString

      public String toString()
      Description copied from class: Attribute
      Generates this attribute's value as a string.
      Overrides:
      toString in class Attribute
      Returns:
      the attribute value.
      See Also: