intarsys PDF library API

de.intarsys.pdf.cds
Class CDSDate

java.lang.Object
  extended by de.intarsys.pdf.cos.COSBasedObject
      extended by de.intarsys.pdf.cds.CDSBase
          extended by de.intarsys.pdf.cds.CDSDate
All Implemented Interfaces:
ICOSObjectListener, IAttributeSupport

public class CDSDate
extends CDSBase

The implementation for a date string based on a COSString.

The string follows the format defined in [PDF], chapter 3.8.2.


Nested Class Summary
 
Nested classes/interfaces inherited from class de.intarsys.pdf.cos.COSBasedObject
COSBasedObject.MetaClass
 
Field Summary
static String DATE_FORMAT
           
static Pattern DatePattern
           
 
Fields inherited from class de.intarsys.pdf.cos.COSBasedObject
META
 
Constructor Summary
CDSDate()
          Create a new date object with the current system date set
 
Method Summary
static CDSDate createFromCOS(COSString string)
          Create a CDSDate from a COSString
static String format(CDSDate cdsDate)
          Format a CDSDate using the default format.
static String format(Format format, CDSDate cdsDate)
          Format a CDSDate using format.
 String stringValue()
          The String representation of this.
 Date toDate()
          The Date represented by this.
static Date toDate(String string)
          Create a Date using the default format.
static Date toDateWithZone(String string)
          Create a Date using the default format using the timezone.
 String toFormattedString()
          A formatted String representation of this.
static String toString(Date date)
           
static String toStringWithZone(Date date)
           
static String toStringWithZone(Date date, TimeZone timeZone)
           
 
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject
changed, cosGetArray, cosGetDict, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, invalidateCaches, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATE_FORMAT

public static final String DATE_FORMAT
See Also:
Constant Field Values

DatePattern

public static final Pattern DatePattern
Constructor Detail

CDSDate

public CDSDate()
Create a new date object with the current system date set

Method Detail

createFromCOS

public static CDSDate createFromCOS(COSString string)
Create a CDSDate from a COSString

Parameters:
string - The base string.
Returns:
Create a CDSDate from a COSString

format

public static String format(CDSDate cdsDate)
Format a CDSDate using the default format.

Parameters:
cdsDate - The CDSDate to be formatted.
Returns:
A formatted String representation.

format

public static String format(Format format,
                            CDSDate cdsDate)
Format a CDSDate using format.

Parameters:
format - The format to be used for formatting
cdsDate - The date to be formatted
Returns:
A formatted String representation of cdsDate

toDate

public static Date toDate(String string)
                   throws ParseException
Create a Date using the default format.

Parameters:
string - The date string.
Returns:
The parsed Date
Throws:
ParseException

toDateWithZone

public static Date toDateWithZone(String string)
                           throws ParseException
Create a Date using the default format using the timezone.

Parameters:
string - The date string.
Returns:
The parsed Date
Throws:
ParseException

toString

public static String toString(Date date)

toStringWithZone

public static String toStringWithZone(Date date)

toStringWithZone

public static String toStringWithZone(Date date,
                                      TimeZone timeZone)

stringValue

public String stringValue()
The String representation of this.

Returns:
The String representation of this.

toDate

public Date toDate()
            throws ParseException
The Date represented by this.

Returns:
The Date represented by this.
Throws:
ParseException

toFormattedString

public String toFormattedString()
A formatted String representation of this.

Returns:
A formatted String representation of this.

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.