fipaos.util
Class UTCContainer

Direct Known Subclasses:
UTCDuration, UTCTime

public class UTCContainer
implements Cloneable, Serializable

Simple container for UTC time data


Field Summary
 final static intDATE
          Constant to represent the date
 final static intHOUR
          Constant to represent the hour of day (24 hour format)
 final static intMILLISECOND
          Constant to represent the millisecond of the second
 final static intMINUTE
          Constant to represent the minute of the hour
 final static intMONTH
          Constant to represent the month
 final static intSECOND
          Constant to represent the second of the minute
 final static intYEAR
          Constant to represent the year

Constructor Summary
UTCContainer(int year, int month, int date, int hour, int minute, int second, int millis)
          Constructs a UTCContainer object from the given parameters

Method Summary
 Objectclone()
           
 booleanequals(UTCContainer otherTime)
          Method to provide a mechanism for determining if two times are the same
 intget(int field)
          Method to allow retreival of individual
fields from the time/date
 booleanisAfter(UTCContainer time)
          Method to provide a way of determining if a UTCContainer object represents a time before
the time this UTCContainer instance represents.
 booleanisBefore(UTCContainer otherTime)
          Method to provide a way of determining if a UTCContainer object represents a time after
the time this UTCContainer instance represents
 voidset(int field, int value)
          Method to allow manual setting of date/time fields
 voidsetAccuracy(int accuracy)
          Method to change accuracy of UTCTime object.
 StringtoString()
          Overrides default Object.toString()

Field Detail

DATE

public final static int DATE
Constant to represent the date

HOUR

public final static int HOUR
Constant to represent the hour of day (24 hour format)

MILLISECOND

public final static int MILLISECOND
Constant to represent the millisecond of the second

MINUTE

public final static int MINUTE
Constant to represent the minute of the hour

MONTH

public final static int MONTH
Constant to represent the month

SECOND

public final static int SECOND
Constant to represent the second of the minute

YEAR

public final static int YEAR
Constant to represent the year
Constructor Detail

UTCContainer

public UTCContainer(int year, int month, int date, int hour, int minute, int second, int millis)
Constructs a UTCContainer object from the given parameters
Parameters:
year - The year
month - The month (1 to 12)
date - The day of the month (1 to (28 thru 31))
hour - The hour of the day (0 to 23)
minute - The minute of the hour (0 to 59)
second - The second of the minute (0 to 59, or -1 for minute precision)
millis - The millisecond of the second (0 to 999, or -1 for second precision)
Method Detail

clone

public Object clone()

equals

public boolean equals(UTCContainer otherTime)
Method to provide a mechanism for determining if two times are the same
Parameters:
time - The time to compare

get

public int get(int field)
Method to allow retreival of individual
fields from the time/date
Parameters:
field - The field which is to be retreived
Returns: The value of the given field

isAfter

public boolean isAfter(UTCContainer time)
Method to provide a way of determining if a UTCContainer object represents a time before
the time this UTCContainer instance represents.
Parameters:
time - A UTCContainer object to compare

isBefore

public boolean isBefore(UTCContainer otherTime)
Method to provide a way of determining if a UTCContainer object represents a time after
the time this UTCContainer instance represents
Parameters:
time - A UTCContainer object to compare

set

public void set(int field, int value)
Method to allow manual setting of date/time fields
Parameters:
field - The field which is to be changed
value - The new value to set the field to

setAccuracy

public void setAccuracy(int accuracy)
Method to change accuracy of UTCTime object. This
can be changed to MINUTE, SECOND or MILLISECOND.
NOTE: Internally the contents of unused fields
will be reset to 0.
Parameters:
accuracy - One of the above constants

toString

public String toString()
Overrides default Object.toString()