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.

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

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

add(Interval)

Add this Interval to another.

asIntervalArray()
 Retrieve the array of Intervals (containing only one Interval) from
this interval.

asTimeValue()
 Retrieve the TimeValue from this Interval

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

divide(Interval)

Divide this Interval by an Interval.

divide(TimeValue)

Divide an Interval by a constant.

enumerateIntervals()
 Create an Enumeration on the Interval.

equals(Interval)

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

equals(Unanchorable)

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

equalTo(Interval)

Is this Interval the same as another?

granularity()
 Retrieve the Granularity from this Interval

greaterThan(Interval)

Is this Interval bigger than another?

greaterThanOrEqualTo(Interval)

Is this Interval bigger than or the same as another?

hashCode()

Generate the hash code value, needed for supporting Hashtables.

image()

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

kind()
 Return the name of this class.

largest()

Get the largest (only!) Interval in this Interval.

lessThan(Interval)

Is this Interval smaller than another?

lessThanOrEqualTo(Interval)

Is this Interval smaller than or the same as another?

multiply(TimeValue)

Multiply an Interval by a constant.

negate()

Negate this Interval and return it.

newInstance(Interval[])
 Construct a new Instance of an Interval

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

smallest()

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

subtract(Interval)

Subtract another Interval from this one.
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
Interval
public Interval(Granularity g,
TimeValue tv)
 Construct an Interval from a TimeValue.
image
public String image()
 Build a nice string image of an Interval, for debugging mostly
 Returns:
 String image of Interval
hashCode
public int hashCode()
 Generate the hash code value, needed for supporting Hashtables.
 Returns:
 int
 Overrides:
 hashCode in class Object
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
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
negate
public Interval negate()
 Negate this Interval and return it.
 Returns:
 this
add
public Interval add(Interval i)
 Add this Interval to another.
 Parameters:
 i  Interval to be added
 Returns:
 this + i
multiply
public Interval multiply(TimeValue n)
 Multiply an Interval by a constant.
 Parameters:
 n  TimeValue to multiply
 Returns:
 this * n
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)
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)
subtract
public Interval subtract(Interval i)
 Subtract another Interval from this one.
 Parameters:
 i  Interval to be subtracted
 Returns:
 this  i
enumerateIntervals
public Enumeration enumerateIntervals()
 Create an Enumeration on the Interval.
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.
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.
smallest
public Interval smallest()
 Get the smallest (only!) Interval in this Interval.
 Returns:
 this
largest
public Interval largest()
 Get the largest (only!) Interval in this Interval.
 Returns:
 this
lessThan
public ExtendedBoolean lessThan(Interval beta)
 Is this Interval smaller than another?
 Parameters:
 beta   Interval to compare
 Returns:
 this < beta
greaterThan
public ExtendedBoolean greaterThan(Interval beta)
 Is this Interval bigger than another?
 Parameters:
 beta   Interval to compare
 Returns:
 this > beta
equalTo
public ExtendedBoolean equalTo(Interval beta)
 Is this Interval the same as another?
 Parameters:
 beta   Interval to compare
 Returns:
 this == beta
lessThanOrEqualTo
public ExtendedBoolean lessThanOrEqualTo(Interval beta)
 Is this Interval smaller than or the same as another?
 Parameters:
 beta   Interval to compare
 Returns:
 this <= beta
greaterThanOrEqualTo
public ExtendedBoolean greaterThanOrEqualTo(Interval beta)
 Is this Interval bigger than or the same as another?
 Parameters:
 beta   Interval to compare
 Returns:
 this >= beta
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.
granularity
public Granularity granularity()
 Retrieve the Granularity from this Interval
 Returns:
 Granularity
asTimeValue
public TimeValue asTimeValue()
 Retrieve the TimeValue from this Interval
 Returns:
 TimeValue
newInstance
public Unanchorable newInstance(Interval i[])
 Construct a new Instance of an Interval
 Returns:
  new Unanchorable
kind
public String kind()
 Return the name of this class.
 Returns:
  new Unanchorable
All Packages Class Hierarchy This Package Previous Next Index