ru.novosoft.dc.rtf.dom.objects
Class RTFDate

java.lang.Object
  |
  +--ru.novosoft.dc.rtf.dom.objects.RTFDate

public final class RTFDate
extends java.lang.Object
implements java.lang.Cloneable

The RTF date class contains date and time information. Month is a number in the range [1..12], date belongs to the range [1..31], hour is a number in the range [0..24], minute and second ranges are [0..59]. The testing on non-negativeness of all fields except the year field is applied.


Field Summary
static byte DATE
          Index of the "day of month" field in the date.
static byte HOUR
          Index of the "hour of day" field in the date.
static byte MINUTE
          Index of the "minute" field in the date.
static byte MONTH
          Index of the "month" field in the date.
static byte SECOND
          Index of the "second" field in the date.
static byte YEAR
          Index of the "year" field in the date.
 
Constructor Summary
RTFDate()
          Construct an RTF date with zero values of all fields.
RTFDate(int year, int month, int date)
          Construct an RTF date from the year, month, and date numbers.
RTFDate(int year, int month, int date, int hour, int minute, int second)
          Construct an RTF date from all numbers.
 
Method Summary
 java.lang.Object clone()
          Creates a deep copy of this object.
 boolean equals(java.lang.Object obj)
          Compare this date with another date and return true if they coinside.
 int get(int index)
          Return the value of the field of the specified index.
 void set(int index, int value)
          Set a value for the field of the specified index (a negative value of any field except the year field is ignored).
 java.lang.String toString()
          Convert a date to the string value in the form "YYYY.MM.DD hh:mm:ss".
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

YEAR

public static final byte YEAR
Index of the "year" field in the date.

MONTH

public static final byte MONTH
Index of the "month" field in the date.

DATE

public static final byte DATE
Index of the "day of month" field in the date.

HOUR

public static final byte HOUR
Index of the "hour of day" field in the date.

MINUTE

public static final byte MINUTE
Index of the "minute" field in the date.

SECOND

public static final byte SECOND
Index of the "second" field in the date.
Constructor Detail

RTFDate

public RTFDate()
Construct an RTF date with zero values of all fields.

RTFDate

public RTFDate(int year,
               int month,
               int date)
Construct an RTF date from the year, month, and date numbers.

RTFDate

public RTFDate(int year,
               int month,
               int date,
               int hour,
               int minute,
               int second)
Construct an RTF date from all numbers.
Method Detail

set

public final void set(int index,
                      int value)
Set a value for the field of the specified index (a negative value of any field except the year field is ignored).

get

public final int get(int index)
Return the value of the field of the specified index.

clone

public java.lang.Object clone()
Creates a deep copy of this object.
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compare this date with another date and return true if they coinside.
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Convert a date to the string value in the form "YYYY.MM.DD hh:mm:ss".
Overrides:
toString in class java.lang.Object