|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unipi.di.util.Range
public class Range
Defines a range [i, j], whose bounds are included.
Constructor Summary | |
---|---|
Range(int i,
int j)
Defines the range [i, j] (bounds included). |
Method Summary | |
---|---|
int |
compareTo(Range r)
Returns -1 if this range is before range r, +1 if it is after range r, or 0 if they are overlapping. |
boolean |
containsPoint(int p)
Check if the input point is contained in this range. |
int |
getLowerBound()
|
int |
getUpperBound()
|
int |
length()
The length of this range. |
static Range |
parseRange(String str)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Range(int i, int j)
i
- lower boundj
- upper boundMethod Detail |
---|
public int getLowerBound()
public int getUpperBound()
public int length()
public int compareTo(Range r)
compareTo
in interface Comparable<Range>
public boolean containsPoint(int p)
p
- the point to check.
public String toString()
toString
in class Object
public static Range parseRange(String str)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |