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:
  • Constructor Details

    • AbstractISO8601Time

      public AbstractISO8601Time()
      The default constructor.
    • AbstractISO8601Time

      public AbstractISO8601Time(String value) throws BadTimeFormatException
      Constructs time value from a string.
      Parameters:
      value - a string containing time value.
      Throws:
      BadTimeFormatException - if value has invalid format
  • Method Details

    • setValue

      public abstract void setValue(String value) throws BadTimeFormatException
      Set an instance of this class from a String containing value notation of the TIME.
      Parameters:
      value - a string containing time value.
      Throws:
      BadTimeFormatException - if value has invalid format
    • toDate

      public final Date 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

      public Date toDate(Calendar calendar)
      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

      public int 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. 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

      public 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. 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".