fipaos.util
Class UTCDuration
java.lang.Object
|
+--fipaos.util.UTCContainer
|
+--fipaos.util.UTCDuration
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class UTCDuration
- extends UTCContainer
Extends UTCContainer - contains a duration specified in relative UTC
format (e.g. 1 hour = "+00000000T010000000")
- See Also:
- Serialized Form
Constructor Summary |
UTCDuration(int year,
int month,
int date,
int hour,
int minute,
int second,
int millisecond)
Constructs a UTCDuration based upon the values given |
UTCDuration(java.lang.String duration)
Constructs a UTCDuration based upon a string based upon the format
+YYYYMMDDTHHmmSSuuu, where Y = year, M = month, D = date, H = hour
m = minute, S = seconds and u = milliseconds |
Method Summary |
void |
addDuration(int year,
int month,
int date,
int hour,
int minute,
int second,
int millis)
|
void |
addDuration(java.lang.String duration)
|
long |
getDurationInMillis()
Returns the number of milliseconds this duration represents - doesn't
use the month or year field since months and years can be a variable
length |
static void |
main(java.lang.String[] args)
|
java.lang.String |
toString()
Overrides UTCContainer.toString() |
void |
validate()
Method to normalise the contents of the UTCDuration object |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UTCDuration
public UTCDuration(java.lang.String duration)
- Constructs a UTCDuration based upon a string based upon the format
+YYYYMMDDTHHmmSSuuu, where Y = year, M = month, D = date, H = hour
m = minute, S = seconds and u = milliseconds
- Parameters:
duration
- Duration specified in relative UTC format
UTCDuration
public UTCDuration(int year,
int month,
int date,
int hour,
int minute,
int second,
int millisecond)
- Constructs a UTCDuration based upon the values given
toString
public java.lang.String toString()
- Overrides UTCContainer.toString()
- Overrides:
toString
in class UTCContainer
- Returns:
- String representation of this UTCDuration
getDurationInMillis
public long getDurationInMillis()
- Returns the number of milliseconds this duration represents - doesn't
use the month or year field since months and years can be a variable
length
addDuration
public void addDuration(java.lang.String duration)
addDuration
public void addDuration(int year,
int month,
int date,
int hour,
int minute,
int second,
int millis)
validate
public void validate()
- Method to normalise the contents of the UTCDuration object
main
public static void main(java.lang.String[] args)