All Packages Class Hierarchy This Package Previous Next Index
Class tadt.standard.TemporalElement
java.lang.Object
|
+----tadt.standard.TemporalElement
- public class TemporalElement
- extends Object
- implements Anchorable
The TemporalElement class implements the Anchorable interface for
TemporalElements.
A TemporalElement is a set of "coalesced" Periods.
So a better name would be CoalescedPeriodSet, but we stick with
this name for purely historical reasons.
There are several different ways to implement this beast, we
adopt a representation as an array of Instants that delimit the
interior Periods.
-
TemporalElement(Period[])
- Construct a TemporalElement from an array of Periods.
-
asInstantArray()
- Retrieve the array of Instants from
this TemporalElement.
-
asPeriodArray()
- Retrieve the array of Periods from
this TemporalElement.
-
earliestInstant()
- Returns the earliest Instant in the TemporalElement.
-
earliestPeriod()
- Returns the earliest Period in the TemporalElement.
-
enumerateInstants()
- Create an Enumeration of Instants in the Anchorable.
-
enumeratePeriods()
- Create an Enumeration of Periods in the Anchorable.
-
equals(Anchorable)
-
Test for equality, needed only for supporting Hashtables, use
equalTo for comparing TemporalElements directly.
-
equals(TemporalElement)
-
Test for equality, needed only for supporting Hashtables, use
equalTo for comparing TemporalElements directly.
-
hashCode()
-
Generate the hash code value, needed for supporting Hashtables.
-
image()
-
Build a nice string image of an TemporalElement, for debugging mostly
-
kind()
- Return the name of this class.
-
latestInstant()
- Returns the latest Instant in the TemporalElement.
-
latestPeriod()
- Returns the latest Period in the TemporalElement.
-
newInstance(String, Instant[])
- Construct a new instance of a TemporalElement, Interval combination
-
newInstance(String, Period[])
- Construct a new instance of a TemporalElement, Interval combination
TemporalElement
public TemporalElement(Period p[])
- Construct a TemporalElement from an array of Periods.
- Parameters:
- periods - - array of Periods
image
public String image()
- Build a nice string image of an TemporalElement, for debugging mostly
- Returns:
- String image of TemporalElement
hashCode
public int hashCode()
- Generate the hash code value, needed for supporting Hashtables.
Use the hash value of the first instant.
- 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 TemporalElements directly.
- Parameters:
- other - - Anchorable to compare
- Returns:
- true or false
equals
public boolean equals(TemporalElement other)
- Test for equality, needed only for supporting Hashtables, use
equalTo for comparing TemporalElements directly.
- Parameters:
- other - - TemporalElement to compare
- Returns:
- true or false
earliestPeriod
public Period earliestPeriod()
- Returns the earliest Period in the TemporalElement.
- Returns:
- Period - the Period
latestPeriod
public Period latestPeriod()
- Returns the latest Period in the TemporalElement.
- Returns:
- the latest Period
earliestInstant
public Instant earliestInstant()
- Returns the earliest Instant in the TemporalElement.
- Returns:
- Instant - the Instant
latestInstant
public Instant latestInstant()
- Returns the latest Instant in the TemporalElement.
- Returns:
- Instant - the Instant
enumeratePeriods
public Enumeration enumeratePeriods()
- Create an Enumeration of Periods in the Anchorable.
enumerateInstants
public Enumeration enumerateInstants()
- Create an Enumeration of Instants in the Anchorable.
asPeriodArray
public Period[] asPeriodArray()
- Retrieve the array of Periods from
this TemporalElement.
- Returns:
- array of Periods (in order from earliest to latest)
asInstantArray
public Instant[] asInstantArray()
- Retrieve the array of Instants from
this TemporalElement.
- Returns:
- array of Instants (in order from earliest to latest)
kind
public String kind()
- Return the name of this class.
- Returns:
- String
newInstance
public Anchorable newInstance(String beta,
Instant i[])
- Construct a new instance of a TemporalElement, Interval combination
- Returns:
- - new Anchorable
newInstance
public Anchorable newInstance(String beta,
Period i[])
- Construct a new instance of a TemporalElement, Interval combination
- Returns:
- - new Anchorable
All Packages Class Hierarchy This Package Previous Next Index