fipaos.util
Class UTCDuration

fipaos.util.UTCContainer
  |
  +--fipaos.util.UTCDuration

public class UTCDuration
extends UTCContainer

Extends UTCContainer - contains a duration specified in relative UTC
format (e.g. 1 hour = "+00000000T010000000")




Fields inherited from class fipaos.util.UTCContainer
DATE, HOUR, MILLISECOND, MINUTE, MONTH, SECOND, YEAR

Constructor Summary
UTCDuration(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
UTCDuration(int year, int month, int date, int hour, int minute, int second, int millisecond)
          Constructs a UTCDuration based upon the values given

Method Summary
 voidaddDuration(String duration)
           
 voidaddDuration(int year, int month, int date, int hour, int minute, int second, int millis)
           
 longgetDurationInMillis()
          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 voidmain(String[] args)
           
 StringtoString()
          Overrides UTCContainer.toString()
 voidvalidate()
          Method to normalise the contents of the UTCDuration object

Methods inherited from class fipaos.util.UTCContainer
clone, equals, get, isAfter, isBefore, set, setAccuracy

Constructor Detail

UTCDuration

public UTCDuration(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
Method Detail

addDuration

public void addDuration(String duration)

addDuration

public void addDuration(int year, int month, int date, int hour, int minute, int second, int millis)

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
result The duration in millis

main

public static void main(String[] args)

toString

public String toString()
Overrides UTCContainer.toString()
Returns: String representation of this UTCDuration

validate

public void validate()
Method to normalise the contents of the UTCDuration object