uk.ac.ic.doc.automed.wrappers
Class AutoMedTime

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.wrappers.AutoMedType
        |
        +--uk.ac.ic.doc.automed.wrappers.AutoMedTime

public class AutoMedTime
extends AutoMedType

Provides generic representation of time values in GMT.

Author:
Peter McBrien (pjm@doc.ic.ac.uk)

Field Summary
static int DAY
          Granularity of one day
static int HOUR
          Granularity of one hour
static int MINUTE
          Granularity of one minute
static int SECOND
          Granularity of one minute
 
Fields inherited from class uk.ac.ic.doc.automed.wrappers.AutoMedType
BOOLEAN, FLOAT, INTEGER, STRING, TIME, TUPLE
 
Constructor Summary
AutoMedTime(java.util.Date value, int granularity)
          Create a new AutoMedTime
AutoMedTime(long time, int granularity)
          Create a new AutoMedTime, measure as the number of milliseconds since 1st January 1970, 00:00:00 GMT
 
Method Summary
 java.util.Date dateValue()
           
 boolean equals(AutoMedType v)
          Test two AutoMedTypes for equality, performing conversions as appropriate.
 int getType()
          Return the Type (INTEGER, TUPLE, ...) of this AutoMedType
 java.lang.String toString()
          Return a string representation of this AutoMedTime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SECOND

public static final int SECOND
Granularity of one minute

See Also:
Constant Field Values

MINUTE

public static final int MINUTE
Granularity of one minute

See Also:
Constant Field Values

HOUR

public static final int HOUR
Granularity of one hour

See Also:
Constant Field Values

DAY

public static final int DAY
Granularity of one day

See Also:
Constant Field Values
Constructor Detail

AutoMedTime

public AutoMedTime(long time,
                   int granularity)
Create a new AutoMedTime, measure as the number of milliseconds since 1st January 1970, 00:00:00 GMT


AutoMedTime

public AutoMedTime(java.util.Date value,
                   int granularity)
Create a new AutoMedTime

Method Detail

dateValue

public java.util.Date dateValue()

toString

public java.lang.String toString()
Return a string representation of this AutoMedTime.

Specified by:
toString in class AutoMedType

equals

public boolean equals(AutoMedType v)
Description copied from class: AutoMedType
Test two AutoMedTypes for equality, performing conversions as appropriate.

Specified by:
equals in class AutoMedType

getType

public final int getType()
Description copied from class: AutoMedType
Return the Type (INTEGER, TUPLE, ...) of this AutoMedType

Specified by:
getType in class AutoMedType