org.odftoolkit.odfdom.dom.type
Class OdfLengthOrPercent

java.lang.Object
  extended by org.odftoolkit.odfdom.dom.type.OdfLengthOrPercent

public class OdfLengthOrPercent
extends Object

DOM implementation of OpenDocument data type 'lengthOrPercent' This value type stores either a measure value in 1/100th mm as int or a percent value as double.


Constructor Summary
OdfLengthOrPercent()
          Construct OdfLengthOrPercent without the initialized value
OdfLengthOrPercent(OdfLengthOrPercent val)
          Copy Construct OdfLengthOrPercent with the same value of val
 
Method Summary
 int getLength()
          get the Length value of this OdfLengthOrPercent Object
 double getPercent()
          get the Percent value of this OdfLengthOrPercent Object
 boolean isPercent()
          get the internal value type of OdfLengthOrPercent Object
 void setLength(int length)
          set Length value for OdfLengthOrPercent Object
 void setPercent(double percent)
          set Percent value for OdfLengthOrPercent Object
 String toString()
          Returns a String Object representing this OdfLengthOrPercent's value
static OdfLengthOrPercent valueOf(String stringValue)
          Returns an OdfLengthOrPercent 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

OdfLengthOrPercent

public OdfLengthOrPercent()
Construct OdfLengthOrPercent without the initialized value


OdfLengthOrPercent

public OdfLengthOrPercent(OdfLengthOrPercent val)
Copy Construct OdfLengthOrPercent with the same value of val

Parameters:
val - the copied OdfLengthOrPercent object
Method Detail

setLength

public void setLength(int length)
set Length value for OdfLengthOrPercent Object

Parameters:
length - the length value which is set to OdfLengthOrPercent Object

setPercent

public void setPercent(double percent)
set Percent value for OdfLengthOrPercent Object

Parameters:
percent - the percent value which is set to OdfLengthOrPercent Object

isPercent

public boolean isPercent()
get the internal value type of OdfLengthOrPercent Object

Returns:
true if the internal value type is Percent false if the internal value type is Length

getLength

public int getLength()
get the Length value of this OdfLengthOrPercent Object

Returns:
the Length value of this OdfLengthOrPercent Object

getPercent

public double getPercent()
get the Percent value of this OdfLengthOrPercent Object

Returns:
the Percent value of this OdfLengthOrPercent Object

toString

public String toString()
Returns a String Object representing this OdfLengthOrPercent's value

Overrides:
toString in class Object
Returns:
return a string representation of the value of this OdfLengthOrPercent object

valueOf

public static OdfLengthOrPercent valueOf(String stringValue)
Returns an OdfLengthOrPercent instance representing the specified String value

Parameters:
stringValue - a String value
Returns:
return an OdfLengthOrPercent instance representing stringValue


Copyright © 2009. All Rights Reserved.