public abstract class IntRange extends Object
min: int
max: int
min <= max
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int i)
Returns true if the given integer is within
this range; otherwise returns false.
|
boolean |
contains(IntRange range)
Returns true if this range contains the
given range.
|
boolean |
equals(Object o)
Returns true if o is an int range with the same endpoints as this.
|
int |
hashCode()
Returns the hash code for this int range.
|
boolean |
intersects(IntRange range)
Returns true if this and the given range intersect.
|
abstract int |
max()
Returns the right endpoint of this range.
|
abstract int |
min()
Returns the left endpoint of this range.
|
int |
size()
Returns the number of element in this range.
|
String |
toString() |
public boolean contains(int i)
public boolean contains(IntRange range)
NullPointerException
- range = nullpublic boolean equals(Object o)
public int hashCode()
public boolean intersects(IntRange range)
NullPointerException
- range = nullpublic abstract int max()
public abstract int min()
public int size()
© Emina Torlak 2005-present