Package com.adobe.xfa
Class Measurement
java.lang.Object
com.adobe.xfa.Attribute
com.adobe.xfa.Measurement
Measurement class. Used for all attributes that are expressed as
an ordinate, such as X, Y, H, W, MinX.
-
Constructor Summary
ConstructorsConstructorDescriptionMeasurement(Attribute attr) Create a Measurement from an attribute.Measurement(UnitSpan unit) Create an Measurement from a UnitSpan.Measurement(String qName, String value) Fully qualified constructor. -
Method Summary
Modifier and TypeMethodDescriptionintgetUnits()Get the internal value as an enum.Get the internal value as a UnitSpandoublegetValue()Get the internal value as a doubledoublegetValueAsUnit(int units) Get the internal value converted to specific units defined in XFAUnitEnumstatic doublegetValueAsUnit(UnitSpan oSpan, int units) Get the value of the provided UnitSpan, converted to specific units defined in XFAUnitEnum.newAttribute(String value) Create a new attribute, given a new valuenewAttribute(String NS, String localName, String qName, String value) Create a new attribute, given all attribute parametersnewAttribute(String NS, String localName, String qName, String value, boolean internSymbols) Create a new attribute, given all attribute parametersvoidNormalizes this attribute.toString()Generates this attribute's value as a string.Methods inherited from class com.adobe.xfa.Attribute
getAttrValue, getLocalName, getName, getNS, getPrefix, getQName, isEmpty, isNameSpaceAttr, isSchemaAttr, isXSINilAttr
-
Constructor Details
-
Measurement
Fully qualified constructor.- Parameters:
qName-value-
-
Measurement
Create a Measurement from an attribute.- Parameters:
attr- the attribute to create the measurement from.
-
Measurement
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
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
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 convertedunits- - the units the value will be converted to (XFAEnum::XFAUnitEnum)- Returns:
- the internal value converted to the given units
-
newAttribute
Description copied from class:AttributeCreate a new attribute, given a new value- Specified by:
newAttributein classAttribute- Parameters:
value- the string to use to create the new attribute- Returns:
- a new attribute
-
newAttribute
Description copied from class:AttributeCreate a new attribute, given all attribute parameters- Specified by:
newAttributein classAttribute- Parameters:
NS- the namespace for this attributelocalName- the local name for this attributeqName- the qualified name for this attributevalue- 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:AttributeCreate a new attribute, given all attribute parameters- Specified by:
newAttributein classAttribute- Parameters:
NS- the namespace for this attributelocalName- the local name for this attributeqName- the qualified name for this attributevalue- the string to use to create the new attributeinternSymbols- indicates whether the symbols in other parameters need to be interned.- Returns:
- a new attribute
-
normalize
public void normalize()Description copied from class:AttributeNormalizes this attribute. This base class implementation simply does nothing, other than allow derived classes the opportunity to do something. -
toString
Description copied from class:AttributeGenerates this attribute's value as a string.
-