All Packages Class Hierarchy This Package Previous Next Index
Class tadt.standard.Instant
java.lang.Object

+tadt.standard.Instant
 public class Instant
 extends Object
 implements Anchorable
The Instant class provides a set of basic operations available on
an Instant such as arithmetic and comparison operations.
An Instant is the only object that has a granularity. Periods
are larger aggregations of Instants.
This is the standard package that supports determinate operations.
None of the operations are mutators, that is, they all
create a new Instant if needed.

Instant(Granularity, BigInteger)
 Construct an Instant from a count of granules, known to be an BigInteger.

Instant(Granularity, TimeValue)
 Construct an Instant from a TimeValue.

add(Interval)
 Add an Interval to this Instant

asInstantArray()
 Retrieve the array of Instants (containing only one Instant) from
this Instant.

asPeriodArray()
 Retrieve the array of Periods (containing only one Period) from
this Period.

asTimeValue()
 Retrieve the TimeValue from this Instant

cast(Granularity)
 Cast this Instant to the indicated granularity.

earliestInstant()
 Returns the earliest (only!) Instant in the Instant.

earliestPeriod()
 Returns the earliest (only!) Period in the Period.

enumerateInstants()
 Create an Enumeration of Instants on the Anchorable.

enumeratePeriods()
 Create an Enumeration of Periods on the Anchorable.

equals(Anchorable)

Test for equality, needed only for supporting Hashtables, use
equalTo for comparing Instants directly.

equals(Instant)

Test for equality, needed only for supporting Hashtables, use
equalTo for comparing Instants directly.

equalTo(Anchorable)
 Is this Instant equalTo another Anchorable? Always false
since the other thing is not an Instant.

equalTo(Instant)

Is this Instant EqualTo another?

first(Anchorable)
 Returns the first Instant out of an Instant and an Anchorable

first(Instant)
 Returns the first Instant out of two Instants

granularity()
 Retrieve the Granularity from this Instant

greaterThan(Anchorable)
 Is this Instant greaterThan another Anchorable?

greaterThan(Instant)

Is this Instant greaterThan another?

greaterThanOrEqualTo(Anchorable)
 Is this Instant greaterThanOrEqualTo another Anchorable?

greaterThanOrEqualTo(Instant)

Is this Instant greaterThanOrEqualTo another?

hashCode()

Generate the hash code value, needed for supporting Hashtables.

image()

Build a nice string image of an Instant, for debugging mostly

kind()
 Return the name of this class.

last(Anchorable)
 Returns the last Instant out of an Instant and an Anchorable

last(Instant)
 Returns the last Instant out of two Instants

latestInstant()
 Returns the latest (only!) Instant in the Instant.

latestPeriod()
 Returns the latest (only!) Period in the Period.

lessThan(Anchorable)

Is this Instant lessThan another Anchorable?

lessThan(Instant)

Is this Instant lessThan another Instant?

lessThanOrEqualTo(Anchorable)
 Is this Instant lessThanOrEqualTo another Anchorable?

lessThanOrEqualTo(Instant)

Is this Instant lessThanOrEqualTo another?

newInstance(String, Instant[])
 Construct a new instance of an Instant, Interval combination

newInstance(String, Period[])
 Construct a new instance of an Instant, Interval combination

scale(Granularity)
 Scale this Instant to the indicated granularity.

subtract(Instant)
 Subtract an Instant from this Instant

subtract(Interval)
 Subtract an Interval from this Instant
Instant
public Instant(Granularity g,
BigInteger granules)
 Construct an Instant from a count of granules, known to be an BigInteger.
 Parameters:
 g   granularity
 granules   distance in granules from the origin
Instant
public Instant(Granularity g,
TimeValue tv)
 Construct an Instant from a TimeValue.
image
public String image()
 Build a nice string image of an Instant, for debugging mostly
 Returns:
 String image of Instant
hashCode
public int hashCode()
 Generate the hash code value, needed for supporting Hashtables.
 Returns:
 int
 Overrides:
 hashCode in class Object
equals
public boolean equals(Anchorable other)
 Test for equality, needed only for supporting Hashtables, use
equalTo for comparing Instants directly. This will always return
false since the other Anchorable is not an Instant.
 Parameters:
 other   Instant to compare
 Returns:
 false
equals
public boolean equals(Instant other)
 Test for equality, needed only for supporting Hashtables, use
equalTo for comparing Instants directly.
 Parameters:
 other   Instant to compare
 Returns:
 true or false
earliestInstant
public Instant earliestInstant()
 Returns the earliest (only!) Instant in the Instant.
 Returns:
 Instant  this Instant
latestInstant
public Instant latestInstant()
 Returns the latest (only!) Instant in the Instant.
 Returns:
 Instant  the Instant
earliestPeriod
public Period earliestPeriod()
 Returns the earliest (only!) Period in the Period.
 Returns:
 Period  this Period
latestPeriod
public Period latestPeriod()
 Returns the latest (only!) Period in the Period.
 Returns:
 Period  the Period
enumeratePeriods
public Enumeration enumeratePeriods()
 Create an Enumeration of Periods on the Anchorable.
enumerateInstants
public Enumeration enumerateInstants()
 Create an Enumeration of Instants on the Anchorable.
cast
public Instant cast(Granularity g)
 Cast this Instant to the indicated granularity.
Note that it is not a mutator, it will create a new Anchorable.
Implemented as identity function.
scale
public Instant scale(Granularity g)
 Scale this Instant to the indicated granularity.
Note that it is not a mutator, it will create a new Instant.
Implemented as identity function.
lessThan
public ExtendedBoolean lessThan(Anchorable beta)
 Is this Instant lessThan another Anchorable?
 Parameters:
 beta   Anchorable to compare
 Returns:
 this < beta
lessThan
public ExtendedBoolean lessThan(Instant beta)
 Is this Instant lessThan another Instant?
 Parameters:
 beta   Instant to compare
 Returns:
 this < beta
lessThanOrEqualTo
public ExtendedBoolean lessThanOrEqualTo(Anchorable beta)
 Is this Instant lessThanOrEqualTo another Anchorable?
 Parameters:
 beta   Anchorable to compare
 Returns:
 this < beta
lessThanOrEqualTo
public ExtendedBoolean lessThanOrEqualTo(Instant beta)
 Is this Instant lessThanOrEqualTo another?
 Parameters:
 beta   Instant to compare
 Returns:
 this <= beta
greaterThan
public ExtendedBoolean greaterThan(Anchorable beta)
 Is this Instant greaterThan another Anchorable?
 Parameters:
 beta   Anchorable to compare
 Returns:
 this < beta
greaterThan
public ExtendedBoolean greaterThan(Instant beta)
 Is this Instant greaterThan another?
 Parameters:
 beta   Instant to compare
 Returns:
 this > beta
equalTo
public ExtendedBoolean equalTo(Anchorable beta)
 Is this Instant equalTo another Anchorable? Always false
since the other thing is not an Instant.
 Parameters:
 beta   Anchorable to compare
 Returns:
 false
equalTo
public ExtendedBoolean equalTo(Instant beta)
 Is this Instant EqualTo another?
 Parameters:
 beta   Instant to compare
 Returns:
 this == beta
greaterThanOrEqualTo
public ExtendedBoolean greaterThanOrEqualTo(Anchorable beta)
 Is this Instant greaterThanOrEqualTo another Anchorable?
 Parameters:
 beta   Anchorable to compare
 Returns:
 this < beta
greaterThanOrEqualTo
public ExtendedBoolean greaterThanOrEqualTo(Instant beta)
 Is this Instant greaterThanOrEqualTo another?
 Parameters:
 beta   Instant to compare
 Returns:
 this >= beta
add
public Instant add(Interval beta)
 Add an Interval to this Instant
 Parameters:
 beta   Interval to add
 Returns:
 Instant  new Instant
subtract
public Instant subtract(Interval beta)
 Subtract an Interval from this Instant
 Parameters:
 beta   Interval to subtract
 Returns:
 Instant  new Instant
first
public Instant first(Anchorable beta)
 Returns the first Instant out of an Instant and an Anchorable
 Parameters:
 beta   Anchorable to compare with
 Returns:
 the earliest Instant
first
public Instant first(Instant beta)
 Returns the first Instant out of two Instants
 Parameters:
 beta   Instant to compare with
 Returns:
 the earliest Instant
last
public Instant last(Anchorable beta)
 Returns the last Instant out of an Instant and an Anchorable
 Parameters:
 beta   Anchorable to compare with
 Returns:
 the latest Instant
last
public Instant last(Instant beta)
 Returns the last Instant out of two Instants
 Parameters:
 beta   Instant to compare with
 Returns:
 the latest Instant
subtract
public Interval subtract(Instant beta)
 Subtract an Instant from this Instant
 Parameters:
 beta   Instant to subtract
 Returns:
 resulting Interval
asPeriodArray
public Period[] asPeriodArray()
 Retrieve the array of Periods (containing only one Period) from
this Period.
 Returns:
 array of Perids with one Period in it.
asInstantArray
public Instant[] asInstantArray()
 Retrieve the array of Instants (containing only one Instant) from
this Instant.
 Returns:
 array of Instants with one Instant in it.
granularity
public Granularity granularity()
 Retrieve the Granularity from this Instant
 Returns:
 Granularity object
kind
public String kind()
 Return the name of this class.
 Returns:
 String
asTimeValue
public TimeValue asTimeValue()
 Retrieve the TimeValue from this Instant
 Returns:
 TimeValue
newInstance
public Anchorable newInstance(String beta,
Period i[])
 Construct a new instance of an Instant, Interval combination
 Returns:
  new Anchorable
newInstance
public Anchorable newInstance(String beta,
Instant i[])
 Construct a new instance of an Instant, Interval combination
 Returns:
  new Anchorable
All Packages Class Hierarchy This Package Previous Next Index