pds.util
Class PPITime

java.lang.Object
  extended by pds.util.PPITime

public class PPITime
extends java.lang.Object

PPITime is a class that contains a methods for parsing, comparing and generating time strings.

Since:
1.0

Field Summary
static java.lang.String ABBRDFS
          1989/01/19 11:45:30.234
static java.lang.String AMER
          jan 19, 1983 11:45:30.234
static java.lang.String AMERDATE
          1/19/83 11:45:30.234
static java.lang.String BINARY
          758979930.234
static java.lang.String CLUSTER
          19-01-1989 11:45:30.234
static java.lang.String DFS
          1989-JAN-19 11:45:30.234
static java.lang.String DOY
          1983 303 11:45:30.234
static java.lang.String EURO
          19 jan 1983 11:45:30.234
static java.lang.String EURODATE
          19.1.83 11:45:30.234
static java.lang.String HIGHLOW
          83 01 19 00 11 45 30.234
static java.lang.String ISEEDATE
          83 019 JAN 19 11 45 30.234
static java.lang.String ISO
          19890119T114530.234
static java.lang.String JAPANDATE
          83.1.19 11:45:30.234
 java.util.Calendar mDate
          The Date variable where parsed values are stored.
 java.util.TimeZone mTimeZone
           
static java.lang.String NIPPONDATE
          83.19.1 11:45:30.234
static java.lang.String PDS
          1989-01-19T11:45:30.234 or 1989-019T11:45:30.234 with omissions
 
Constructor Summary
PPITime()
          Creates an instance of a time value.
PPITime(PPITime item)
          Creates an instance of a time value.
 
Method Summary
 void advance(double minutes)
          Advances the time by a specified number of minutes.
 int compareTo(PPITime anotherTime)
          Compare a time to this instance for ordering.
 boolean convert(java.lang.String pattern, java.lang.String buffer)
          Parses a string into a Date using the given pattern.
 void copy(PPITime item)
          Makes a copy of a PPITime item.
 void dawn()
          Sets the time to the earliest possible time.
 void eternity()
          Sets the time to the latest possible time.
static java.lang.String findSpec(java.lang.String name)
          Returns the time format specification that matches the given standard format name.
 java.lang.String format(java.lang.String pattern)
          Formats the time in the requested format and returns the string.
static void main(java.lang.String[] args)
          Execute the class from the command line
 void now()
          Sets the date to the current system time.
 long span(PPITime other)
          Returns the number of milliseconds between a time and this time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AMERDATE

public static final java.lang.String AMERDATE
1/19/83 11:45:30.234

See Also:
Constant Field Values

EURODATE

public static final java.lang.String EURODATE
19.1.83 11:45:30.234

See Also:
Constant Field Values

AMER

public static final java.lang.String AMER
jan 19, 1983 11:45:30.234

See Also:
Constant Field Values

EURO

public static final java.lang.String EURO
19 jan 1983 11:45:30.234

See Also:
Constant Field Values

DOY

public static final java.lang.String DOY
1983 303 11:45:30.234

See Also:
Constant Field Values

JAPANDATE

public static final java.lang.String JAPANDATE
83.1.19 11:45:30.234

See Also:
Constant Field Values

NIPPONDATE

public static final java.lang.String NIPPONDATE
83.19.1 11:45:30.234

See Also:
Constant Field Values

HIGHLOW

public static final java.lang.String HIGHLOW
83 01 19 00 11 45 30.234

See Also:
Constant Field Values

ISEEDATE

public static final java.lang.String ISEEDATE
83 019 JAN 19 11 45 30.234

See Also:
Constant Field Values

DFS

public static final java.lang.String DFS
1989-JAN-19 11:45:30.234

See Also:
Constant Field Values

ABBRDFS

public static final java.lang.String ABBRDFS
1989/01/19 11:45:30.234

See Also:
Constant Field Values

PDS

public static final java.lang.String PDS
1989-01-19T11:45:30.234 or 1989-019T11:45:30.234 with omissions

See Also:
Constant Field Values

ISO

public static final java.lang.String ISO
19890119T114530.234

See Also:
Constant Field Values

BINARY

public static final java.lang.String BINARY
758979930.234

See Also:
Constant Field Values

CLUSTER

public static final java.lang.String CLUSTER
19-01-1989 11:45:30.234

See Also:
Constant Field Values

mTimeZone

public java.util.TimeZone mTimeZone

mDate

public java.util.Calendar mDate
The Date variable where parsed values are stored. Also the value of this element is used when generating formatted output.

Constructor Detail

PPITime

public PPITime()
Creates an instance of a time value. The instance is not initialized and must be either using now() convert(), or copy().

Since:
1.0

PPITime

public PPITime(PPITime item)
Creates an instance of a time value. The instance is initialized as a copy of the passed argument.

Parameters:
item - the instance of a PPITime value to initialize this instance with.
Since:
1.0
Method Detail

main

public static void main(java.lang.String[] args)
Execute the class from the command line


convert

public boolean convert(java.lang.String pattern,
                       java.lang.String buffer)
Parses a string into a Date using the given pattern. The pattern can be specified using one of the predefined formats or it can be specified using the syntax used by @see SimpleDateFormat.

Parameters:
pattern - the text containing the pattern to parse buffer with.
buffer - the text containing the string to parse.
Returns:
true if the string could be parsed. false if any error occured.
Since:
1.0

format

public java.lang.String format(java.lang.String pattern)
Formats the time in the requested format and returns the string.

Parameters:
pattern - the text containing the pattern to format the time as.
Returns:
a string containing the formatted time value.
Since:
1.0

findSpec

public static java.lang.String findSpec(java.lang.String name)
Returns the time format specification that matches the given standard format name. If no match is found the passed string is returned.

Parameters:
name - the name of the standard format.
Returns:
a string containing the format specification that matches the passed name. If no match is found the passed string is returned.
Since:
1.0

dawn

public void dawn()
Sets the time to the earliest possible time.

Since:
1.0

eternity

public void eternity()
Sets the time to the latest possible time.

Since:
1.0

compareTo

public int compareTo(PPITime anotherTime)
Compare a time to this instance for ordering.

Parameters:
anotherTime - the PPITime to compare to this time.
Returns:
the value 0 if the passed argument is equal to this instance; a value less than 0 if the this instance is before the passed argument; and a value greater than 0 if the this instance is after the passed argument.
Since:
1.0

copy

public void copy(PPITime item)
Makes a copy of a PPITime item.

Parameters:
item - the instance of the PPITime item to copy.
Since:
1.0

advance

public void advance(double minutes)
Advances the time by a specified number of minutes.

Parameters:
minutes - the number of minutes to advance the time by. The value may include a fractional minute.
Since:
1.0

now

public void now()
Sets the date to the current system time.

Since:
1.0

span

public long span(PPITime other)
Returns the number of milliseconds between a time and this time.

Parameters:
item - the instance of the PPITime item to compare to.
Since:
1.0