|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.unimi.dsi.mg4j.search.Interval
An integral interval. An interval is defined
by two integers, called its left and right
extremes.
This class has no constructor: use the static factories
getInstance(int, int) and getInstance(int), instead.
Instances of this class are immutable. To reduce garbage collection, intervals made of one non-negative small points are precomputed and returned upon request.
| Field Summary | |
int |
left
The left extreme of the interval. |
int |
right
The right extreme of the interval. |
| Method Summary | |
boolean |
equals(Object o)
|
static Interval |
getInstance(int point)
Returns a one-point interval. |
static Interval |
getInstance(int left,
int right)
Returns an interval with given extremes. |
int |
hashCode()
|
int |
length()
Returns the interval length, that is, the number of integers contained in the interval. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final int left
public final int right
| Method Detail |
public static Interval getInstance(int left,
int right)
left - the left extreme.right - the right extreme (which must be greater than
or equal to the left extreme).
public static Interval getInstance(int point)
point - a point.
public int length()
public String toString()
public int hashCode()
public boolean equals(Object o)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||