|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.balana.attr.AttributeValue
org.wso2.balana.attr.DayTimeDurationAttribute
public class DayTimeDurationAttribute
Representation of an xf:dayTimeDuration value. This class supports parsing xd:dayTimeDuration
values. All objects of this class are immutable and thread-safe. The Date
objects
returned are not, but these objects are cloned before being returned.
Field Summary | |
---|---|
static String |
identifier
Official name of this type |
Constructor Summary | |
---|---|
DayTimeDurationAttribute(boolean negative,
long days,
long hours,
long minutes,
long seconds,
int nanoseconds)
Creates a new DayTimeDurationAttribute that represents the duration supplied. |
Method Summary | |
---|---|
String |
encode()
Encodes the value in a form suitable for including in XML data like a request or an obligation. |
boolean |
equals(Object o)
Returns true if the input is an instance of this class and if its value equals the value contained in this class. |
long |
getDays()
Gets the number of days. |
long |
getHours()
Gets the number of hours. |
static DayTimeDurationAttribute |
getInstance(Node root)
Returns a new DayTimeDurationAttribute that represents the xf:dayTimeDuration at
a particular DOM node. |
static DayTimeDurationAttribute |
getInstance(String value)
Returns a new DayTimeDurationAttribute that represents the xf:dayTimeDuration
value indicated by the string provided. |
long |
getMinutes()
Gets the number of minutes. |
int |
getNanoseconds()
Gets the number of nanoseconds. |
long |
getSeconds()
Gets the number of seconds. |
long |
getTotalSeconds()
Gets the total number of round seconds (in milliseconds). |
int |
hashCode()
Returns the hashcode value used to index and compare this object with others of the same type. |
boolean |
isNegative()
Returns true if the duration is negative. |
String |
toString()
Converts to a String representation. |
Methods inherited from class org.wso2.balana.attr.AttributeValue |
---|
encode, encodeWithTags, evaluate, evaluatesToBag, getChildren, getType, isBag, returnsBag |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String identifier
Constructor Detail |
---|
public DayTimeDurationAttribute(boolean negative, long days, long hours, long minutes, long seconds, int nanoseconds) throws IllegalArgumentException
DayTimeDurationAttribute
that represents the duration supplied.
negative
- true if the duration is negative, false otherwisedays
- the number of days in the durationhours
- the number of hours in the durationminutes
- the number of minutes in the durationseconds
- the number of seconds in the durationnanoseconds
- the number of nanoseconds in the duration
IllegalArgumentException
- if the total number of milliseconds exceeds Long.MAX_LONGMethod Detail |
---|
public static DayTimeDurationAttribute getInstance(Node root) throws ParsingException, NumberFormatException
DayTimeDurationAttribute
that represents the xf:dayTimeDuration at
a particular DOM node.
root
- the Node
that contains the desired value
DayTimeDurationAttribute
representing the appropriate value (null
if there is a parsing error)
ParsingException
NumberFormatException
public static DayTimeDurationAttribute getInstance(String value) throws ParsingException, NumberFormatException
DayTimeDurationAttribute
that represents the xf:dayTimeDuration
value indicated by the string provided.
value
- a string representing the desired value
DayTimeDurationAttribute
representing the desired value (null if
there is a parsing error)
ParsingException
NumberFormatException
public boolean isNegative()
public long getDays()
public long getHours()
public long getMinutes()
public long getSeconds()
public int getNanoseconds()
public long getTotalSeconds()
public boolean equals(Object o)
equals
in class Object
o
- the object to compare
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public String encode()
encode
in class AttributeValue
String
form of the value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |