jp.bitmeister.asn1.type
Class TimeType

java.lang.Object
  extended by jp.bitmeister.asn1.type.ASN1Type
      extended by jp.bitmeister.asn1.type.PrimitiveType<byte[]>
          extended by jp.bitmeister.asn1.type.builtin.OCTET_STRING
              extended by jp.bitmeister.asn1.type.StringType
                  extended by jp.bitmeister.asn1.type.TimeType
All Implemented Interfaces:
java.lang.Cloneable, Concatenatable<OCTET_STRING>, SizeCountable
Direct Known Subclasses:
GeneralizedTime, UTCTime

public abstract class TimeType
extends StringType

The base class for types which contains a String that represents date and time.

This class provides generic interfaces and common methods for classes which represents date and time types.

Author:
WATANABE, Jun.

Field Summary
 
Fields inherited from class jp.bitmeister.asn1.type.ASN1Type
stringBuilder
 
Constructor Summary
TimeType()
           
 
Method Summary
<R,E extends java.lang.Throwable>
R
accept(ASN1Visitor<R,E> visitor)
          Accepts the ASN1Visitor and calls a visit method of the visitor.
 java.nio.charset.Charset charset()
          Returns the Charset used for encoding and decodiong the value of this data.
 java.util.Date date()
          Returns a Date converted from the value of this instance.
abstract  java.text.DateFormat form()
          Returns the DateFormat used for formatting the date and time.
protected abstract  java.util.Date parseDate(java.lang.String time, java.lang.String differential)
          Parses and converts the strings represents a set of date, time and time defferential to a Date.
 void set(java.util.Date value)
          Converts the Date object to a formatted String that represents date and time, and set it to this instance.
 
Methods inherited from class jp.bitmeister.asn1.type.StringType
checkCharacters, pattern, set, stringValue
 
Methods inherited from class jp.bitmeister.asn1.type.builtin.OCTET_STRING
cloneValue, concatenate, set, size, valueEquals
 
Methods inherited from class jp.bitmeister.asn1.type.PrimitiveType
clear, clone, hashCode, hasValue, set, value
 
Methods inherited from class jp.bitmeister.asn1.type.ASN1Type
equals, instantiate, matches, specification, toString, validate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeType

public TimeType()
Method Detail

set

public void set(java.util.Date value)
Converts the Date object to a formatted String that represents date and time, and set it to this instance.

Parameters:
value - The Date to be assigned.

date

public java.util.Date date()
Returns a Date converted from the value of this instance.

Returns:
A Date.

form

public abstract java.text.DateFormat form()
Returns the DateFormat used for formatting the date and time.

Returns:
The date format.

charset

public java.nio.charset.Charset charset()
Description copied from class: StringType
Returns the Charset used for encoding and decodiong the value of this data.

Specified by:
charset in class StringType
Returns:
The Charset.

accept

public <R,E extends java.lang.Throwable> R accept(ASN1Visitor<R,E> visitor)
         throws E extends java.lang.Throwable
Description copied from class: ASN1Type
Accepts the ASN1Visitor and calls a visit method of the visitor.

Overrides:
accept in class StringType
Parameters:
visitor - The visitor.
Returns:
Result.
Throws:
E - When an error occured in the visit method of the visitor.
E extends java.lang.Throwable

parseDate

protected abstract java.util.Date parseDate(java.lang.String time,
                                            java.lang.String differential)
Parses and converts the strings represents a set of date, time and time defferential to a Date.

Parameters:
time - The String represents a set of date.
differential - The String represents a time differential.
Returns:
A Date object that converted from the time and the differential.