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 Summary
Constructors Constructor Description Measurement(Attribute attr)Create a Measurement from an attribute.Measurement(UnitSpan unit)Create an Measurement from a UnitSpan.Measurement(java.lang.String qName, java.lang.String value)Fully qualified constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetUnits()Get the internal value as an enum.UnitSpangetUnitSpan()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.AttributenewAttribute(java.lang.String value)Create a new attribute, given a new valueAttributenewAttribute(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.String value)Create a new attribute, given all attribute parametersAttributenewAttribute(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.String value, boolean internSymbols)Create a new attribute, given all attribute parametersvoidnormalize()Normalizes this attribute.java.lang.StringtoString()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 Detail
-
Measurement
public Measurement(java.lang.String qName, java.lang.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 Detail
-
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 convertedunits- - the units the value will be converted to (XFAEnum::XFAUnitEnum)- Returns:
- the internal value converted to the given units
-
newAttribute
public Attribute newAttribute(java.lang.String value)
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
public Attribute newAttribute(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.String value)
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(java.lang.String NS, java.lang.String localName, java.lang.String qName, java.lang.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.
-
-