Package com.oss.asn1
Class AbstractISO8601Time
java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.AbstractISO8601Time
- All Implemented Interfaces:
com.oss.asn1.Comparable
,ISO8601TimeInterface
,Serializable
,Cloneable
- Direct Known Subclasses:
ISO8601Date
,ISO8601DateTime
,ISO8601Duration
,ISO8601TimeOfDay
public abstract class AbstractISO8601Time
extends AbstractData
implements ISO8601TimeInterface, com.oss.asn1.Comparable
The ISO8601Time class implements the functionality common to all
ASN.1 useful time types: DATE, TIME-OF-DAY, DATE-TIME and DURATION.
This abstract base class is a public class, but it is not considered as being part of the public API and should not be directly referenced in your application programs.
- Since:
- ASN.1/Java 4.0 Beta A
- See Also:
-
Field Summary
Fields inherited from class com.oss.asn1.AbstractData
EQUALS, GREATER_THAN, LESS_THAN
Fields inherited from interface com.oss.asn1.ISO8601TimeInterface
CENTURY, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_YEAR, FRACTIONAL_DIGITS, FRACTIONAL_VALUE, HOUR, MINUTE, MINUTE_DIFFERENTIAL, MONTH, SECOND, UNDEFINED, UTC, WEEK, YEAR, YEAR_DIGITS
-
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.AbstractISO8601Time
(String value) Constructs time value from a string. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(AbstractISO8601Time that) Compare 'this' object to another AbstractISO8601Time object to determine whether the contents of this object is less than, equal to, or greater than the contents of other object.int
compareTo
(AbstractISO8601Time that, TimeZone zone, Locale locale) Compare 'this' object to another AbstractISO8601Time object to determine whether the contents of this object is less than, equal to, or greater than the contents of other object.abstract void
Set an instance of this class from a String containing value notation of the TIME.final Date
toDate()
Get a Java Date object primed with the data from 'this' AbstractISO8601Time object.Get a Java Date object primed with the data from 'this' AbstractISO8601Time object using the calendar "calendar".Methods inherited from class com.oss.asn1.AbstractData
abstractEqualTo, clone, delete, equals, getTypeInfo, hashCode, isEncodable, isPDU, isValid, toString, toString
Methods inherited from interface com.oss.asn1.ISO8601TimeInterface
clear, get, set
-
Constructor Details
-
AbstractISO8601Time
public AbstractISO8601Time()The default constructor. -
AbstractISO8601Time
Constructs time value from a string.- Parameters:
value
- a string containing time value.- Throws:
BadTimeFormatException
- ifvalue
has invalid format
-
-
Method Details
-
setValue
Set an instance of this class from a String containing value notation of the TIME.- Parameters:
value
- a string containing time value.- Throws:
BadTimeFormatException
- ifvalue
has invalid format
-
toDate
Get a Java Date object primed with the data from 'this' AbstractISO8601Time object.- Returns:
- reference to the Java Date object set to 'this' object's year, month, day, hour, minute and second.
-
toDate
Get a Java Date object primed with the data from 'this' AbstractISO8601Time object using the calendar "calendar".- Parameters:
calendar
- the Calendar to use to compute the Date.- Returns:
- reference to the Java Date set to 'this' object's year, month, day, hour, minute and second by using "calendar".
-
compareTo
Compare 'this' object to another AbstractISO8601Time object to determine whether the contents of this object is less than, equal to, or greater than the contents of other object. The contents of Java Date objects primed with the data from 'this' object and another object are compared.- Parameters:
that
- the AbstractISO8601Time object to compare this object to.- Returns:
- LESS_THAN (-1) if the date specified by 'this' before the date specified by "that". EQUALS (0) if the date specified by 'this' is the same as the date specified by "that". GREATER_THAN (1) if the date specified by 'this' after the date specified by "that".
-
compareTo
Compare 'this' object to another AbstractISO8601Time object to determine whether the contents of this object is less than, equal to, or greater than the contents of other object. The contents of Java Date objects primed with the data from 'this' object and another object are compared.- Parameters:
that
- the AbstractISO8601Time object to compare this object to.- Returns:
- LESS_THAN (-1) if the date specified by 'this' before the date specified by "that". EQUALS (0) if the date specified by 'this' is the same as the date specified by "that". GREATER_THAN (1) if the date specified by 'this' after the date specified by "that".
-