public class ASDate extends ASObject implements Comparable
| Constructor and Description |
|---|
ASDate()
Create an ASDate that references this moment in time.
|
ASDate(ASString dateString)
Create an ASDate that point to the moment in time given by the String representation
using the format given in the PDF 1.6 spec on page 133.
|
ASDate(Date date)
Create an ASDate that points to the moment in time given by the
Date. |
ASDate(Date date,
TimeZone zone)
Create an ASDate that points to the moment in time given by the
Date. |
ASDate(String dateString)
Create an ASDate that point to the moment in time given by the String representation
using the format given in the PDF 1.6 spec on page 133.
|
ASDate(String dateString,
TimeZone zone) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
after(ASDate otherDate)
Tests if this date is after the specified date.
|
String |
asString()
Generates a String for output to the serialized PDF.
|
boolean |
before(ASDate otherDate)
Tests if this date is before the specified date.
|
int |
compareTo(ASDate otherASDate)
Compares two Dates for ordering.
|
int |
compareTo(Object obj)
Compares two Dates for ordering.
|
boolean |
equals(Object obj) |
TimeZone |
getTimeZone()
Return the
TimeZone represented by this ASDate if the internal representation is valid. |
int |
hashCode() |
boolean |
hasTimeZone()
Returns if timezone is set explicitly set for this date
|
boolean |
isDateValid()
If the
ASDate object was instantiated with a string then it may be invalid and not
represent a correct date as per the PDF spec. |
Date |
toDate()
Return the
Date represented by this ASDate if the internal representation is valid. |
String |
toString()
Generates a String for debugging, messages, etc.
|
String |
toStringTimezoneUnaware() |
void |
write(OutputByteStream outputByteStream)
Writes the ADate to the given OutputByteStream in the format expected by the PDF Spec.
|
public ASDate()
public ASDate(Date date)
Date.public ASDate(Date date, TimeZone zone)
Date.public ASDate(String dateString) throws PDFParseException
PDFParseExceptionpublic ASDate(ASString dateString) throws PDFParseException
PDFParseExceptionpublic ASDate(String dateString, TimeZone zone) throws PDFParseException
PDFParseExceptionpublic boolean isDateValid()
ASDate object was instantiated with a string then it may be invalid and not
represent a correct date as per the PDF spec. If the date is not valid then there is no way to
convert the internal representation to a real date or timezone.true if the date is valid; false otherwisepublic int compareTo(Object obj)
compareTo in interface Comparableobj - the ASDate to be compared.0 if the argument ASDate is equal to
this ASDate; a value less than 0 if this ASDate
is before the ASDate argument; and a value greater than
0 if this ASDate is after the ASDate argument.public int compareTo(ASDate otherASDate)
otherASDate - the ASDate to be compared.0 if the argument ASDate is equal to
this ASDate; a value less than 0 if this ASDate
is before the ASDate argument; and a value greater than
0 if this ASDate is after the ASDate argument. Invalid
dates are considered to be before other dates.public boolean before(ASDate otherDate)
otherDate - an ASDatetrue if and only if the instant represented by this ASDate
is strictly earlier than the instant represented by otherDate;
false otherwisepublic boolean after(ASDate otherDate)
otherDate - an ASDatetrue if and only if the instant represented by this ASDate
is strictly later than the instant represented by otherDate;
false otherwisepublic String asString()
public String toString()
public String toStringTimezoneUnaware()
public Date toDate()
Date represented by this ASDate if the internal representation is valid.public boolean hasTimeZone()
public TimeZone getTimeZone()
TimeZone represented by this ASDate if the internal representation is valid.public void write(OutputByteStream outputByteStream) throws PDFIOException
write in class ASObjectoutputByteStream - OutputByteStream to write to.PDFIOExceptionASStringCopyright © 2010 - 2020 Adobe. All Rights Reserved