|
||||||||||
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.TimeAttribute
public class TimeAttribute
Representation of an xs:time value. This class supports parsing xs:time 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 |
static int |
TZ_UNSPECIFIED
Time zone value that indicates that the time zone was not specified. |
Constructor Summary | |
---|---|
TimeAttribute()
Creates a new TimeAttribute that represents the current time in the current time
zone. |
|
TimeAttribute(Date time)
Creates a new TimeAttribute that represents the given time but uses the default
timezone and offset values. |
|
TimeAttribute(Date time,
int nanoseconds,
int timeZone,
int defaultedTimeZone)
Creates a new TimeAttribute that represents the time 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. |
int |
getDefaultedTimeZone()
Gets the time zone actually used for this object (if it was originally unspecified, the default time zone used). |
static TimeAttribute |
getInstance(Node root)
Returns a new TimeAttribute that represents the xs:time at a particular DOM
node. |
static TimeAttribute |
getInstance(String value)
Returns a new TimeAttribute that represents the xs:time value indicated by the
string provided. |
long |
getMilliseconds()
Gets the number of milliseconds since midnight GMT that this attribute value represents. |
int |
getNanoseconds()
Gets the nanoseconds of this object. |
int |
getTimeZone()
Gets the time zone of this object (or TZ_UNSPECIFIED if unspecified). |
Date |
getValue()
Gets the time represented by this object. |
int |
hashCode()
Returns the hashcode value used to index and compare this object with others of the same type. |
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
public static final int TZ_UNSPECIFIED
Constructor Detail |
---|
public TimeAttribute()
TimeAttribute
that represents the current time in the current time
zone.
public TimeAttribute(Date time)
TimeAttribute
that represents the given time but uses the default
timezone and offset values.
time
- a Date
object representing the specified time down to second
resolution. This date should have a date of 01/01/1970. If it does not, such a
date will be forced. If this object has non-zero milliseconds, they are combined
with the nanoseconds parameter.public TimeAttribute(Date time, int nanoseconds, int timeZone, int defaultedTimeZone)
TimeAttribute
that represents the time supplied.
time
- a Date
object representing the specified time down to second
resolution. This date should have a date of 01/01/1970. If it does not, such a
date will be forced. If this object has non-zero milliseconds, they are combined
with the nanoseconds parameter.nanoseconds
- the number of nanoseconds beyond the Date specified in the date parametertimeZone
- the time zone specified for this object (or TZ_UNSPECIFIED if unspecified).
The offset to GMT, in minutes.defaultedTimeZone
- the time zone actually used for this object, which must be
specified. The offset to GMT, in minutes.Method Detail |
---|
public static TimeAttribute getInstance(Node root) throws ParsingException, NumberFormatException, ParseException
TimeAttribute
that represents the xs:time at a particular DOM
node.
root
- the Node
that contains the desired value
TimeAttribute
representing the appropriate value (null if there is
a parsing error)
ParsingException
NumberFormatException
ParseException
public static TimeAttribute getInstance(String value) throws ParsingException, NumberFormatException, ParseException
TimeAttribute
that represents the xs:time value indicated by the
string provided.
value
- a string representing the desired value
TimeAttribute
representing the desired value (null if there is a
parsing error)
ParsingException
- if any problems occurred while parsing
NumberFormatException
ParseException
public Date getValue()
Date
object
representing the specified time down to second resolution with a date of January 1, 1970.
Subsecond values are handled by the getNanoseconds
method.
Date
object representing the time represented by this objectpublic long getMilliseconds()
getValue
, and likewise the milliseconds are
provided with second resolution.
public int getNanoseconds()
public int getTimeZone()
public int getDefaultedTimeZone()
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 |