|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IInterval
A segment has a left and a right index and is understood to represent a semi-closed
range [left, right). In otherwords, the value 'left' intersects this segment while
the value 'right' does not.
To be a proper segment, the left value must be strictly less than the right value.
While this is assumed to be an invariant, code that depends upon IInterval may choose
to check this assumption where appropriate.
Implementations of this class must provide Object.equals(Object)
,
Object.hashCode()
and Object.toString()
.
Method Summary | |
---|---|
int |
getLeft()
Return left index. |
int |
getRight()
Return right index. |
boolean |
intersects(int q)
Determines if the q value is greater than or equal to getLeft() and strictly less than getRight() |
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. |
Method Detail |
---|
int getLeft()
int getRight()
boolean toTheLeft(int q)
q
- boolean toTheRight(int q)
q
- boolean intersects(int q)
q
-
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |