org.odftoolkit.odfdom.type
Class Duration

java.lang.Object
  extended by org.odftoolkit.odfdom.type.Duration
All Implemented Interfaces:
OdfDataType, OdfFieldDataType

public class Duration
extends java.lang.Object
implements OdfFieldDataType, OdfDataType

This class represents the in OpenDocument format used data type


Constructor Summary
Duration(javax.xml.datatype.Duration duration)
          Construct DurationType by the parsing the given string
 
Method Summary
 javax.xml.datatype.Duration getValue()
          Returns the value of this DurationType object as an Duration
static boolean isValid(javax.xml.datatype.Duration duration)
          check if the specified Duration instance is a valid data type
 java.lang.String toString()
          Returns a String Object representing this DurationType's value
static Duration valueOf(java.lang.String stringValue)
          Returns a DurationType 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

Duration

public Duration(javax.xml.datatype.Duration duration)
         throws java.lang.IllegalArgumentException
Construct DurationType by the parsing the given string

Parameters:
duration - The String to be parsed into DurationType
Throws:
java.lang.IllegalArgumentException - if the given argument is not a valid Duration
Method Detail

toString

public java.lang.String toString()
Returns a String Object representing this DurationType's value

Overrides:
toString in class java.lang.Object
Returns:
return a string representation of the value of this DurationType object

valueOf

public static Duration valueOf(java.lang.String stringValue)
                        throws java.lang.IllegalArgumentException
Returns a DurationType instance representing the specified String value

Parameters:
stringValue - a String value
Returns:
return a DurationType instance representing stringValue
Throws:
java.lang.IllegalArgumentException - if the given argument is not a valid Duration

getValue

public javax.xml.datatype.Duration getValue()
Returns the value of this DurationType object as an Duration

Returns:
the Duration value of this DurationType object.

isValid

public static boolean isValid(javax.xml.datatype.Duration duration)
check if the specified Duration instance is a valid data type

Parameters:
duration - the value to be tested
Returns:
true if the value of argument is valid for data type false otherwise


Copyright © 2008-2010 ODF Toolkit Project. All Rights Reserved.