Interval Class Reference

Inheritance diagram for Interval:
Collaboration diagram for Interval:

List of all members.


Detailed Description

The Interval class maintains an interval with some associated data

Author:
Kevin Dolan
Parameters:
<Type>The type of data being stored

Public Methods

 Interval (int start, int end, int data)
boolean contains (long time)
boolean intersects (Interval other)
boolean contains (Interval other)
int compareTo (Interval other)

Public Fields

final int data

Package Attributes

final int start
final int end

Constructors

Interval ( int  start,
int  end,
int  data 
)

Method Details

int compareTo ( Interval  other)

Return -1 if this interval's start time is less than the other, 1 if greater In the event of a tie, -1 if this interval's end time is less than the other, 1 if greater, 0 if same

Parameters:
other
Returns:
1 or -1
boolean contains ( long  time)
Parameters:
time
Returns:
true if this interval contains time (inclusive)
boolean contains ( Interval  other)
boolean intersects ( Interval  other)
Parameters:
other
Returns:
return true if this interval intersects other

Field Details

final int data
final int end [package]
final int start [package]