|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odftoolkit.odfdom.type.Length
public class Length
This class represents the in OpenDocument format used data type length
Nested Class Summary | |
---|---|
static class |
Length.Unit
Measurement units for ODF datatype length |
Constructor Summary | |
---|---|
Length(String length)
Construct Length by the parsing the given string |
Method Summary | |
---|---|
static boolean |
isValid(String stringValue)
Check if the specified String instance is a valid length data type |
String |
mapToUnit(Length.Unit destinationUnit)
|
static String |
mapToUnit(String length,
Length.Unit destinationUnit)
Maps the a length string to a different unit |
static double |
parseDouble(String length)
Returns the value of the given length as double. |
static double |
parseDouble(String length,
Length.Unit destinationUnit)
Maps the a length string to a different unit |
static int |
parseInt(String length)
Returns the value of the given length as int. |
static int |
parseInt(String length,
Length.Unit destinationUnit)
Returns the value of the given length as int. |
static long |
parseLong(String length)
Returns the value of the given length as long. |
static long |
parseLong(String length,
Length.Unit destinationUnit)
Maps the a length string to a different unit |
static Length.Unit |
parseUnit(String length)
Returns the Unit of the given length. |
String |
toString()
Returns a String Object representing this Length's value |
static Length |
valueOf(String stringValue)
Returns a Length instance representing the specified String value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Length(String length) throws NumberFormatException
length
- The String to be parsed into Length
NumberFormatException
- if the given argument is not a valid LengthMethod Detail |
---|
public static boolean isValid(String stringValue)
stringValue
- the value to be tested
public static Length.Unit parseUnit(String length)
length
- the Unit
should be obtained from
Unit
object representing the specified Length unit.public static int parseInt(String length)
length
- the int
value should be obtained from
int
value representing the specified Length value.public static int parseInt(String length, Length.Unit destinationUnit)
length
- the int
value should be obtained fromdestinationUnit
- The unit to be converted to
int
value representing the specified Length value.public static long parseLong(String length)
length
- the long
value should be obtained from
long
value representing the specified Length value.public static long parseLong(String length, Length.Unit destinationUnit)
length
- The value to be mappeddestinationUnit
- The unit to be converted to
public static double parseDouble(String length)
length
- the double
value should be obtained from
double
value representing the specified Length value.public static double parseDouble(String length, Length.Unit destinationUnit)
length
- The value to be mappeddestinationUnit
- The unit to be converted to
public String mapToUnit(Length.Unit destinationUnit)
destinationUnit
- The unit to be converted to
public static String mapToUnit(String length, Length.Unit destinationUnit)
length
- The value to be mappeddestinationUnit
- The unit to be converted to
public static Length valueOf(String stringValue) throws NumberFormatException
stringValue
- a String value
NumberFormatException
- if the given argument is not a valid Lengthpublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |