public final class Measurement extends Attribute
| Constructor and Description |
|---|
Measurement(Attribute attr)
Create a Measurement from an attribute.
|
Measurement(String qName,
String value)
Fully qualified constructor.
|
Measurement(UnitSpan unit)
Create an Measurement from a UnitSpan.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getUnits()
Get the internal value as an enum.
|
UnitSpan |
getUnitSpan()
Get the internal value as a UnitSpan
|
double |
getValue()
Get the internal value as a double
|
double |
getValueAsUnit(int units)
Get the internal value converted to specific units defined in XFAUnitEnum
|
static double |
getValueAsUnit(UnitSpan oSpan,
int units)
Get the value of the provided UnitSpan, converted to specific units defined
in XFAUnitEnum.
|
Attribute |
newAttribute(String value)
Create a new attribute, given a new value
|
Attribute |
newAttribute(String NS,
String localName,
String qName,
String value)
Create a new attribute, given all attribute parameters
|
Attribute |
newAttribute(String NS,
String localName,
String qName,
String value,
boolean internSymbols)
Create a new attribute, given all attribute parameters
|
void |
normalize()
Normalizes this attribute.
|
String |
toString()
Generates this attribute's value as a string.
|
getAttrValue, getLocalName, getName, getNS, getPrefix, getQName, isEmpty, isNameSpaceAttr, isSchemaAttr, isXSINilAttrpublic Measurement(String qName, String value)
qName - value - public Measurement(Attribute attr)
attr - the attribute to create the measurement from.public Measurement(UnitSpan unit)
unit - the UnitSpan to create the measurement from.public int getUnits()
public UnitSpan getUnitSpan()
public double getValue()
public double getValueAsUnit(int units)
units - the units the value will be converted to
(EnumAttr.XFAUnitEnum)public static double getValueAsUnit(UnitSpan oSpan, int units)
oSpan - - the UnitSpan whose value should be convertedunits - - the units the value will be converted to (XFAEnum::XFAUnitEnum)public Attribute newAttribute(String value)
AttributenewAttribute in class Attributevalue - the string to use to create the new attributepublic Attribute newAttribute(String NS, String localName, String qName, String value)
AttributenewAttribute in class AttributeNS - 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 attributepublic Attribute newAttribute(String NS, String localName, String qName, String value, boolean internSymbols)
AttributenewAttribute in class AttributeNS - 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.public void normalize()
Attributepublic String toString()
AttributetoString in class AttributeObject.toString()Copyright © 2010 - 2020 Adobe. All Rights Reserved