public class Date
extends java.lang.Object
Constructor and Description |
---|
Date()
Date default constructor.
|
Date(Obj d)
Create a Date and initialize it using given Cos/SDF string date object.
|
Date(short year,
byte month,
byte day,
byte hour,
byte minute,
byte second)
Create a Date and initialize it using specified parameters.
|
Modifier and Type | Method and Description |
---|---|
static Date |
__Create(long impl) |
long |
__GetHandle() |
void |
attach(Obj d)
Attach the Cos/SDF object to the Date.
|
boolean |
equals(java.lang.Object other) |
byte |
getDay()
Get the day.
|
byte |
getHour()
Get the hour.
|
byte |
getMinute()
Get the minute.
|
byte |
getMonth()
Get the month.
|
byte |
getSecond()
Get the second.
|
byte |
getUT()
Get the relationship of local time to Universal Time(UT), denoted by one
of the characters +, -, or Z
|
byte |
getUTHour()
Get the absolute value of the offset from UT in hours(00-23)
|
byte |
getUTMinutes()
Get the absolute value of the offset from UT in minutes(00-59)
|
short |
getYear()
Get the year.
|
int |
hashCode() |
boolean |
isValid()
Indicates whether the Date is valid(non-null).
|
void |
setCurrentTime()
Set the current time.
|
void |
setDay(byte day)
Set the day.
|
void |
setHour(byte hour)
Set the hour.
|
void |
setMinute(byte minute)
Set the minute.
|
void |
setMonth(byte month)
Set the month.
|
void |
setSecond(byte second)
Set the second.
|
void |
setUT(byte ut)
Set the relationship of local time to Universal Time(UT),
|
void |
setUTHour(byte ut_hour)
Set the absolute value of the offset from UT in hours(00-23)
|
void |
setYear(short year)
Set the year.
|
void |
seUTMinutes(byte ut_minutes)
Set the absolute value of the offset from UT in minutes(00-59)
|
boolean |
update()
Saves changes made to the Date object in the attached(or specified) SDF/Cos string.
|
boolean |
update(Obj d)
Saves changes made to the Date object in the attached(or specified) SDF/Cos string.
|
public Date() throws PDFNetException
PDFNetException
public Date(Obj d) throws PDFNetException
d
- input string date objectPDFNetException
public Date(short year, byte month, byte day, byte hour, byte minute, byte second) throws PDFNetException
year
- month
- day
- hour
- minute
- second
- PDFNetException
public boolean isValid() throws PDFNetException
Note: If this method returns false the underlying SDF/Cos object is null and the Date object should be treated as null as well.
PDFNetException
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void attach(Obj d) throws PDFNetException
d
- - underlying Cos/SDF object. Must be an SDF::Str containing
a PDF date object.PDFNetException
public boolean update() throws PDFNetException
PDFNetException
public boolean update(Obj d) throws PDFNetException
d
- - an optional parameter indicating a SDF string that should be updated and
attached to this Date. If parameter d is NULL or is omitted, update is performed on
previously attached Cos/SDF date.PDFNetException
public void setCurrentTime()
public short getYear() throws PDFNetException
PDFNetException
public byte getMonth() throws PDFNetException
PDFNetException
public byte getDay() throws PDFNetException
PDFNetException
public byte getHour() throws PDFNetException
PDFNetException
public byte getMinute() throws PDFNetException
PDFNetException
public byte getSecond() throws PDFNetException
PDFNetException
public byte getUT() throws PDFNetException
PDFNetException
public byte getUTHour() throws PDFNetException
PDFNetException
public byte getUTMinutes() throws PDFNetException
PDFNetException
public void setYear(short year) throws PDFNetException
year
- the new yearPDFNetException
public void setMonth(byte month) throws PDFNetException
month
- the new monthPDFNetException
public void setDay(byte day) throws PDFNetException
day
- the new dayPDFNetException
public void setHour(byte hour) throws PDFNetException
hour
- the new hourPDFNetException
public void setMinute(byte minute) throws PDFNetException
minute
- the new minutePDFNetException
public void setSecond(byte second) throws PDFNetException
second
- the new secondPDFNetException
public void setUT(byte ut) throws PDFNetException
ut
- the relationship of local time to Universal Time(UT),PDFNetException
public void setUTHour(byte ut_hour) throws PDFNetException
ut_hour
- the absolute value of the offset from UT in hours(00-23)PDFNetException
public void seUTMinutes(byte ut_minutes) throws PDFNetException
ut_minutes
- the absolute value of the offset from UT in minutes(00-59)PDFNetException
public static Date __Create(long impl)
public long __GetHandle()