|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.interval.DiscreteInterval
public class DiscreteInterval
Represents a discrete interval [left,right) that implements IInterval.
The interval [left,right) is closed on left, but open on right.
Constructor Summary | |
---|---|
DiscreteInterval(int left,
int right)
Create a discrete interval whose left is strictly less than its right. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Compare DiscreteInterval objects. |
int |
getLeft()
Return the left value of the interval. |
int |
getRight()
Return the right value of the interval. |
int |
hashCode()
Returns the hashCode for this DiscreteInterval. |
boolean |
intersects(int q)
Determines if the q value is greater than or equal to getLeft() and strictly less than getRight() |
java.lang.String |
toString()
Return reasonable String representation. |
boolean |
toTheLeft(int q)
Determines if the q value is strictly less than the getLeft() value. |
boolean |
toTheRight(int q)
Determines if the q value is greater than or equal to the getRight() value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DiscreteInterval(int left, int right)
left
- leftmost value in interval (open)right
- rightmost value in interval (closed)Method Detail |
---|
public int getLeft()
getLeft
in interface IInterval
public int getRight()
getRight
in interface IInterval
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- object against which to compare.public int hashCode()
hashCode
in class java.lang.Object
DiscreteInterval
.public java.lang.String toString()
toString
in class java.lang.Object
public boolean intersects(int q)
IInterval
intersects
in interface IInterval
public boolean toTheLeft(int q)
IInterval
toTheLeft
in interface IInterval
public boolean toTheRight(int q)
IInterval
toTheRight
in interface IInterval
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |