|
Data Request Broker 2-3-release |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.gael.drb.value.DayTimeDuration
fr.gael.drb.value.Duration
public class Duration
The DateTime class is a generic wrapper for Date values. WARNING : In this implementation, a year is fixed to 365.25 sideral days.
| Field Summary | |
|---|---|
protected long |
yearMonth
The year/month part of this duration (in months). |
| Fields inherited from class fr.gael.drb.value.DayTimeDuration |
|---|
dayTime |
| Fields inherited from interface fr.gael.drb.value.Value |
|---|
ARRAY_ID, BINARY_ID, BINARY_INTEGER_ID, BOOLEAN_ID, BYTE_ID, DATE_ID, DATE_TIME_ID, DAY_ID, DAY_TIME_DURATION_ID, DECIMAL_ID, DOUBLE_ID, DURATION_ID, FLOAT_ID, INT_ID, INTEGER_ID, LONG_ID, MONTH_DAY_ID, MONTH_ID, NULL_ID, NUMERIC_ID, OTHER_ID, SHORT_ID, STRING_ID, TIME_ID, UNKNOWN_ID, UNSIGNED_BYTE_ID, UNSIGNED_INT_ID, UNSIGNED_LONG_ID, UNSIGNED_SHORT_ID, YEAR_ID, YEAR_MONTH_DURATION_ID, YEAR_MONTH_ID |
| Fields inherited from interface fr.gael.drb.DrbItem |
|---|
ATTRIBUTE_ITEM, NODE_ITEM, UNDEFINED_ITEM, VALUE_ITEM |
| Constructor Summary | |
|---|---|
Duration(long year_month,
double day_time)
Build a duration from a number of month and a time. |
|
| Method Summary | |
|---|---|
Value |
add(Value x)
Compute an addition. |
void |
assign(Value v)
Assign a new Value. |
int |
compareTo(Value v)
Compare this value with another value. |
Value |
convertTo(int type)
Convert the value into the specified type. |
Value |
divide(Value x)
Compute a division. |
int |
getItemType()
A code that identifies the value items. |
String |
getName()
Name of the item. |
String |
getNamespaceURI()
Get namespace URI. |
int |
getPriority()
The absolute priority of the value. |
int |
getType()
The type identifier of the value. |
Value |
getValue()
The value of the item. |
static void |
main(String[] args)
Makes this class runnable for testing. |
Value |
modulus(Value x)
Compute a modulus. |
Value |
multiply(Value x)
Compute a multiplication. |
static Duration |
parseDuration(String s)
Attempts to interpret the string s as a representation of an ISO 8601 duration. |
void |
rename(String name)
Changes the name of the item. |
void |
setNamespaceURI(String namespace_uri)
Sets a namespace resource identifier. |
Value |
setValue(Value value)
Changes the value of the item. |
Value |
sub(Value x)
Compute a substraction. |
Numeric |
toNumeric()
Convert the value into the numeric type. |
String |
toString()
Return the duration in a string. |
Value |
unaryMinus()
Compute an unary minus. |
| Methods inherited from class fr.gael.drb.value.DayTimeDuration |
|---|
getDayTime |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected long yearMonth
| Constructor Detail |
|---|
public Duration(long year_month,
double day_time)
year_month - number of month in this durationday_time - number of second in this durationDate| Method Detail |
|---|
public static Duration parseDuration(String s)
s - string to be parsed as a duration.
Datepublic String toString()
toString in class DayTimeDurationpublic int getType()
getType in interface ValuegetType in class DayTimeDuration
public Value convertTo(int type)
throws ClassCastException
convertTo in interface ValueconvertTo in class DayTimeDurationtype - The target type.
ClassCastException - if the conversion is impossible.public void assign(Value v)
assign in interface Valueassign in class DayTimeDurationv - the value to be assigned.public int getPriority()
getPriority in interface ValuegetPriority in class DayTimeDurationpublic Value add(Value x)
add in interface Sumableadd in class DayTimeDurationx - another value.
public Value unaryMinus()
unaryMinus in interface ArithmeticunaryMinus in class DayTimeDurationpublic Value sub(Value x)
sub in interface Arithmeticsub in class DayTimeDurationx - another value.
public Value multiply(Value x)
multiply in interface Arithmeticmultiply in class DayTimeDurationx - another value.
public Value divide(Value x)
divide in interface Arithmeticdivide in class DayTimeDurationx - another value.
public Value modulus(Value x)
modulus in interface Arithmeticmodulus in class DayTimeDurationx - another value.
public int compareTo(Value v)
compareTo in interface ComparisoncompareTo in class DayTimeDurationv - another value.
public static void main(String[] args)
args - the given arguments in command line.public int getItemType()
getItemType in interface DrbItempublic String getName()
getName in interface DrbItem
public void rename(String name)
throws NullPointerException,
UnsupportedOperationException
rename in interface DrbItemname - Reference to the new name.
UnsupportedOperationException - This exception always raised because
the name property is not defined for values.
NullPointerException - This exception is overriden by an
UnsupportedOperationException.public String getNamespaceURI()
getNamespaceURI in interface DrbItem
public void setNamespaceURI(String namespace_uri)
throws NullPointerException,
UnsupportedOperationException
setNamespaceURI in interface DrbItemnamespace_uri - A reference to the new namespace identifier.
UnsupportedOperationException - This exception always raised because
the name property is not defined for values.
NullPointerException - This exception is overriden by an
UnsupportedOperationException.public Value getValue()
getValue in interface DrbItem
public Value setValue(Value value)
throws NullPointerException,
ClassCastException,
UnsupportedOperationException
setValue in interface DrbItemvalue - The new value of the node. This value shall not be null.
NullPointerException - This exception is raised when the passed
reference to the value is null. This exception may be overriden
by an UnsupportedOperationException.
ClassCastException - This exception is raised when the
implementation has not succeeded to cast the input value in a
type compatible with the current node.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested assignment for
any reason.
public Numeric toNumeric()
throws ClassCastException
ClassCastException - is the convertion is impossible
|
Data Request Broker - DRB API® 2-3-release |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||