All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tadt.standard.Interval

java.lang.Object
   |
   +----tadt.standard.Interval

public class Interval
extends Object
implements Unanchorable
The Interval class provides a set of basic operations available on an Interval such as arithmetic and comparison operations. This is the standard package that supports determinate operations. Note that none of the operations are mutators, that is, they all create a new Interval if needed.


Constructor Index

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

Method Index

 o add(Interval)
Add this Interval to another.
 o asIntervalArray()
Retrieve the array of Intervals (containing only one Interval) from this interval.
 o asTimeValue()
Retrieve the TimeValue from this Interval
 o cast(Granularity)
Cast this Interval to the indicated granularity.
 o divide(Interval)
Divide this Interval by an Interval.
 o divide(TimeValue)
Divide an Interval by a constant.
 o enumerateIntervals()
Create an Enumeration on the Interval.
 o equals(Interval)
Test for equality, needed only for supporting Hashtables, use equalTo for comparing Intervals directly.
 o equals(Unanchorable)
Test for equality, needed only for supporting Hashtables, use equalTo for comparing Intervals directly.
 o equalTo(Interval)
Is this Interval the same as another?
 o granularity()
Retrieve the Granularity from this Interval
 o greaterThan(Interval)
Is this Interval bigger than another?
 o greaterThanOrEqualTo(Interval)
Is this Interval bigger than or the same as another?
 o hashCode()
Generate the hash code value, needed for supporting Hashtables.
 o image()
Build a nice string image of an Interval, for debugging mostly
 o kind()
Return the name of this class.
 o largest()
Get the largest (only!) Interval in this Interval.
 o lessThan(Interval)
Is this Interval smaller than another?
 o lessThanOrEqualTo(Interval)
Is this Interval smaller than or the same as another?
 o multiply(TimeValue)
Multiply an Interval by a constant.
 o negate()
Negate this Interval and return it.
 o newInstance(Interval[])
Construct a new Instance of an Interval
 o scale(Granularity)
Scale this Interval to the indicated granularity.
 o smallest()
Get the smallest (only!) Interval in this Interval.
 o subtract(Interval)
Subtract another Interval from this one.

Constructors

 o Interval
  public Interval(Granularity g,
                  BigInteger granules)
Construct an Interval from a count of granules, known to be an BigInteger.

Parameters:
g - - granularity
granules - - distance in granules
 o Interval
  public Interval(Granularity g,
                  TimeValue tv)
Construct an Interval from a TimeValue.

Methods

 o image
  public String image()
Build a nice string image of an Interval, for debugging mostly

Returns:
String image of Interval
 o hashCode
  public int hashCode()
Generate the hash code value, needed for supporting Hashtables.

Returns:
int
Overrides:
hashCode in class Object
 o equals
  public boolean equals(Unanchorable other)
Test for equality, needed only for supporting Hashtables, use equalTo for comparing Intervals directly.

Parameters:
other - - Interval to compare
Returns:
true or false
 o equals
  public boolean equals(Interval other)
Test for equality, needed only for supporting Hashtables, use equalTo for comparing Intervals directly.

Parameters:
other - - Interval to compare
Returns:
true or false
 o negate
  public Interval negate()
Negate this Interval and return it.

Returns:
-this
 o add
  public Interval add(Interval i)
Add this Interval to another.

Parameters:
i - Interval to be added
Returns:
this + i
 o multiply
  public Interval multiply(TimeValue n)
Multiply an Interval by a constant.

Parameters:
n - TimeValue to multiply
Returns:
this * n
 o divide
  public TimeValue divide(Interval i)
Divide this Interval by an Interval.

Parameters:
i - Interval to divide by
Returns:
this / i
Throws: divideByZero
(division by zero length interval)
 o divide
  public Interval divide(TimeValue n)
Divide an Interval by a constant.

Parameters:
n - - TimeValue to divide by
Returns:
this / n
Throws: divideByZero
(division by zero)
 o subtract
  public Interval subtract(Interval i)
Subtract another Interval from this one.

Parameters:
i - Interval to be subtracted
Returns:
this - i
 o enumerateIntervals
  public Enumeration enumerateIntervals()
Create an Enumeration on the Interval.

 o cast
  public Interval cast(Granularity g)
Cast this Interval to the indicated granularity. Note that it is not a mutator, it will create a new Anchorable. Implemented as identity function.

 o scale
  public Interval scale(Granularity g)
Scale this Interval to the indicated granularity. Note that it is not a mutator, it will create a new Interval. Implemented as identity function.

 o smallest
  public Interval smallest()
Get the smallest (only!) Interval in this Interval.

Returns:
this
 o largest
  public Interval largest()
Get the largest (only!) Interval in this Interval.

Returns:
this
 o lessThan
  public ExtendedBoolean lessThan(Interval beta)
Is this Interval smaller than another?

Parameters:
beta - - Interval to compare
Returns:
this < beta
 o greaterThan
  public ExtendedBoolean greaterThan(Interval beta)
Is this Interval bigger than another?

Parameters:
beta - - Interval to compare
Returns:
this > beta
 o equalTo
  public ExtendedBoolean equalTo(Interval beta)
Is this Interval the same as another?

Parameters:
beta - - Interval to compare
Returns:
this == beta
 o lessThanOrEqualTo
  public ExtendedBoolean lessThanOrEqualTo(Interval beta)
Is this Interval smaller than or the same as another?

Parameters:
beta - - Interval to compare
Returns:
this <= beta
 o greaterThanOrEqualTo
  public ExtendedBoolean greaterThanOrEqualTo(Interval beta)
Is this Interval bigger than or the same as another?

Parameters:
beta - - Interval to compare
Returns:
this >= beta
 o asIntervalArray
  public Interval[] asIntervalArray()
Retrieve the array of Intervals (containing only one Interval) from this interval.

Returns:
array of Intervals with one Interval in it.
 o granularity
  public Granularity granularity()
Retrieve the Granularity from this Interval

Returns:
Granularity
 o asTimeValue
  public TimeValue asTimeValue()
Retrieve the TimeValue from this Interval

Returns:
TimeValue
 o newInstance
  public Unanchorable newInstance(Interval i[])
Construct a new Instance of an Interval

Returns:
- new Unanchorable
 o kind
  public String kind()
Return the name of this class.

Returns:
- new Unanchorable

All Packages  Class Hierarchy  This Package  Previous  Next  Index