Package com.oss.asn1

Class AbstractTime

java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.AbstractTime
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
GeneralizedTime, UTCTime

public abstract class AbstractTime extends AbstractData
The AbstractTime class is the superclass of the two ASN.1 time types, GeneralizedTime and UTCTime.
Since:
ASN.1/Java 1.0-beta A
See Also:
  • Field Summary

    Fields inherited from class com.oss.asn1.AbstractData

    EQUALS, GREATER_THAN, LESS_THAN
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    Get the day component of 'this' object.
    final int
    Get the hour component of 'this' object.
    final int
    Get the minute component of 'this' object.
    final int
    Get the minute-differential component of 'this' object.
    final int
    Get the month component of 'this' object.
    final int
    Get the second component of 'this' object.
    final int
    Get the year component of 'this' object.
    int
    Returns a hash code for this object
    int[]
    Get an int array containing the components of this object.
    final void
    setDay(int day)
    Set the day component of 'this' object.
    final void
    setHour(int hour)
    Set the hour component of 'this' object.
    final void
    setMinute(int minute)
    Set the minute component of 'this' object.
    void
    setMinuteDifferential(int minDiff)
    Set the minute-differential component of 'this' object.
    final void
    setMonth(int month)
    Set the month component of 'this' object.
    final void
    setSecond(int second)
    Set the second component of 'this' object.
    final void
    setValue(int[] components)
    Set the value of an AbstractTime object from an array of int that contains the year, month, day, hour, minute, second and minute-differential.
    final void
    setYear(int year)
    Set the year component of 'this' object.
    final Date
    Get a Java Date object primed with the data from 'this' AbstractTime object.
    toDate(Calendar calendar)
    Get a Java Date object primed with the data from 'this' AbstractTime object using the calendar "calendar".

    Methods inherited from class com.oss.asn1.AbstractData

    abstractEqualTo, clone, delete, equals, getTypeInfo, isEncodable, isPDU, isValid, toString, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • getYear

      public final int getYear()
      Get the year component of 'this' object.
      Returns:
      int value indicating the year.
    • getMonth

      public final int getMonth()
      Get the month component of 'this' object.
      Returns:
      int value indicating the month.
    • getDay

      public final int getDay()
      Get the day component of 'this' object.
      Returns:
      int value indicating the day.
    • getHour

      public final int getHour()
      Get the hour component of 'this' object.
      Returns:
      int value indicating the hour.
    • getMinute

      public final int getMinute()
      Get the minute component of 'this' object.
      Returns:
      int value indicating the minute.
    • getSecond

      public final int getSecond()
      Get the second component of 'this' object.
      Returns:
      int value indicating the second.
    • getMinuteDifferential

      public final int getMinuteDifferential()
      Get the minute-differential component of 'this' object.
      Returns:
      int value indicating the minute-differential.
    • setYear

      public final void setYear(int year)
      Set the year component of 'this' object.
      Parameters:
      year - the year to set.
    • setMonth

      public final void setMonth(int month)
      Set the month component of 'this' object.
      Parameters:
      month - the month to set.
    • setDay

      public final void setDay(int day)
      Set the day component of 'this' object.
      Parameters:
      day - the day to set.
    • setHour

      public final void setHour(int hour)
      Set the hour component of 'this' object.
      Parameters:
      hour - the hour to set.
    • setMinute

      public final void setMinute(int minute)
      Set the minute component of 'this' object.
      Parameters:
      minute - the minute to set.
    • setSecond

      public final void setSecond(int second)
      Set the second component of 'this' object.
      Parameters:
      second - the second to set.
    • setMinuteDifferential

      public void setMinuteDifferential(int minDiff)
      Set the minute-differential component of 'this' object.
      Parameters:
      minDiff - the minute-differential to set.
    • setValue

      public final void setValue(int[] components)
      Set the value of an AbstractTime object from an array of int that contains the year, month, day, hour, minute, second and minute-differential.
      Parameters:
      components - an array of time components.
    • intArrayValue

      public int[] intArrayValue()
      Get an int array containing the components of this object. The components are in the order: year, month, day, hour, minute, second, minute-differential.
      Returns:
      int array of time components.
    • toDate

      public final Date toDate()
      Get a Java Date object primed with the data from 'this' AbstractTime object. Note that the precision stops at seconds, milliseconds are lost.
      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' AbstractTime object using the calendar "calendar". Note that the precision stops at seconds, milliseconds are lost.
      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".
    • hashCode

      public int hashCode()
      Returns a hash code for this object
      Overrides:
      hashCode in class AbstractData
      Returns:
      a hash code for this object