Interface AbsoluteInstant

All Superinterfaces:
Cloneable, org.gvsig.tools.lang.Cloneable, Instant, Time

public interface AbsoluteInstant extends Instant, org.gvsig.tools.lang.Cloneable

It defines a partial time that does not support every datetime field, and is thus a local time. It cannot be compared to a RelativeInstant, as it does not fully specify an instant in time.

The time it does specify is a local time, and does not include a time zone. An AbsoluteInstant supports a subset of the fields on the chronology.

A huge part of the documentation of this class has been retrieved from the joda-time library.

Version:
$Id$
Author:
gvSIG team
  • Method Details

    • size

      int size()
      Gets the number of fields in this absolute instant.
      Returns:
      the field count
    • getFieldType

      AbsoluteInstantType getFieldType(int index)
      Gets the field type at the specified index.
      Parameters:
      index - the index to retrieve
      Returns:
      the field at the specified index
    • getValue

      int getValue(int index)
      Gets the value of the field at the specifed index.
      Parameters:
      index - the index
      Returns:
      the value
      Throws:
      IndexOutOfBoundsException - if the index is invalid
    • getYears

      int getYears()
      Gets the number of years of this absolute instant.
      Returns:
      the number of years
    • getMonths

      int getMonths()
      Gets the number of months of this absolute instant.
      Returns:
      the number of months
    • getWeeks

      int getWeeks()
      Gets the number of weeks of this absolute instant.
      Returns:
      the number of weeks
    • getDays

      int getDays()
      Gets the number of days of this absolute instant.
      Returns:
      the number of days
    • getHours

      int getHours()
      Gets the number of hours of this absolute instant.
      Returns:
      the number of hours
    • getMinutes

      int getMinutes()
      Gets the number of minutes of this absolute instant.
      Returns:
      the number of minutes
    • getSeconds

      int getSeconds()
      Gets the number of seconds of this absolute instant.
      Returns:
      the number of seconds
    • getMillis

      int getMillis()
      Gets the number of millis of this absolute instant.
      Returns:
      the number of millis
    • toStandardDuration

      Duration toStandardDuration()
      Gets the duration of the instant. It returns a duration assuming a 365 days year, 12 months year, 30 days month, 7 day week, 24 hour day, 60 minute hour, 60 second minute and 1000 millis second.
      Returns:
      a duration equivalent to this instant from the time 0
    • minus

      Gets a copy of this instance with the specified period take away. If the amount is zero or null, then this is returned. *
      Parameters:
      period - the period to reduce this instant by
      Returns:
      a copy of this instance with the period taken away
      Throws:
      ArithmeticException - if the new instant exceeds the capacity of a long
    • plus

      Gets a copy of this instance with the specified period added. If the amount is zero or null, then this is returned.
      Parameters:
      period - the duration to add to this one, null means zero
      Returns:
      a copy of this instance with the period added
      Throws:
      ArithmeticException - if the new instant exceeds the capacity of a long