|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection java.util.AbstractList groovy.lang.ObjectRange
public class ObjectRange extends java.util.AbstractList
Represents an inclusive list of objects from a value to a value using comparators.
This class is similar to IntRange. If you make any changes to this class, you might consider making parallel changes to IntRange.Constructor Summary | |
ObjectRange(java.lang.Comparable from, java.lang.Comparable to)
Creates a new ObjectRange. |
|
ObjectRange(java.lang.Comparable from, java.lang.Comparable to, boolean reverse)
|
Method Summary | |
---|---|
boolean
|
contains(java.lang.Object value)
|
boolean
|
containsWithinBounds(java.lang.Object value)
Checks whether a value is between the from and to values of a Range |
protected java.lang.Object
|
decrement(java.lang.Object value)
|
boolean
|
equals(java.lang.Object that)
{@inheritDoc} |
boolean
|
equals(ObjectRange that)
Compares an ObjectRange to another ObjectRange. |
java.lang.Object
|
get(int index)
{@inheritDoc} |
java.lang.Comparable
|
getFrom()
{@inheritDoc} |
java.lang.Comparable
|
getTo()
{@inheritDoc} |
protected java.lang.Object
|
increment(java.lang.Object value)
|
java.lang.String
|
inspect()
|
boolean
|
isReverse()
{@inheritDoc} |
java.util.Iterator
|
iterator()
{@inheritDoc} |
int
|
size()
{@inheritDoc} |
void
|
step(int step, Closure closure)
{@inheritDoc} |
java.util.List
|
step(int step)
{@inheritDoc} |
java.util.List
|
subList(int fromIndex, int toIndex)
{@inheritDoc} |
java.lang.String
|
toString()
{@inheritDoc} |
Methods inherited from class java.util.AbstractList | |
---|---|
java.util.AbstractList#add(java.lang.Object), java.util.AbstractList#add(int, java.lang.Object), java.util.AbstractList#get(int), java.util.AbstractList#equals(java.lang.Object), java.util.AbstractList#hashCode(), java.util.AbstractList#indexOf(java.lang.Object), java.util.AbstractList#clear(), java.util.AbstractList#lastIndexOf(java.lang.Object), java.util.AbstractList#subList(int, int), java.util.AbstractList#remove(int), java.util.AbstractList#addAll(int, java.util.Collection), java.util.AbstractList#iterator(), java.util.AbstractList#set(int, java.lang.Object), java.util.AbstractList#listIterator(), java.util.AbstractList#listIterator(int), java.util.AbstractList#toString(), java.util.AbstractList#size(), java.util.AbstractList#isEmpty(), java.util.AbstractList#contains(java.lang.Object), java.util.AbstractList#toArray(), java.util.AbstractList#toArray([Ljava.lang.Object;), java.util.AbstractList#remove(java.lang.Object), java.util.AbstractList#addAll(java.util.Collection), java.util.AbstractList#containsAll(java.util.Collection), java.util.AbstractList#removeAll(java.util.Collection), java.util.AbstractList#retainAll(java.util.Collection), java.util.AbstractList#wait(long), java.util.AbstractList#wait(long, int), java.util.AbstractList#wait(), java.util.AbstractList#getClass(), java.util.AbstractList#notify(), java.util.AbstractList#notifyAll(), java.util.AbstractList#size() |
Methods inherited from class java.util.AbstractCollection | |
---|---|
java.util.AbstractCollection#add(java.lang.Object), java.util.AbstractCollection#toString(), java.util.AbstractCollection#clear(), java.util.AbstractCollection#size(), java.util.AbstractCollection#isEmpty(), java.util.AbstractCollection#contains(java.lang.Object), java.util.AbstractCollection#toArray(), java.util.AbstractCollection#toArray([Ljava.lang.Object;), java.util.AbstractCollection#remove(java.lang.Object), java.util.AbstractCollection#addAll(java.util.Collection), java.util.AbstractCollection#iterator(), java.util.AbstractCollection#containsAll(java.util.Collection), java.util.AbstractCollection#removeAll(java.util.Collection), java.util.AbstractCollection#retainAll(java.util.Collection), java.util.AbstractCollection#wait(long), java.util.AbstractCollection#wait(long, int), java.util.AbstractCollection#wait(), java.util.AbstractCollection#equals(java.lang.Object), java.util.AbstractCollection#hashCode(), java.util.AbstractCollection#getClass(), java.util.AbstractCollection#notify(), java.util.AbstractCollection#notifyAll() |
Constructor Detail |
---|
public ObjectRange(java.lang.Comparable from, java.lang.Comparable to)
from
< to
.
from
- the first value in the range.to
- the last value in the range.
public ObjectRange(java.lang.Comparable from, java.lang.Comparable to, boolean reverse)
Method Detail |
---|
public boolean contains(java.lang.Object value)
public boolean containsWithinBounds(java.lang.Object value)
value
- the value of interest
protected java.lang.Object decrement(java.lang.Object value)
public boolean equals(java.lang.Object that)
public boolean equals(ObjectRange that)
that
- the object to check equality withtrue
if the ranges are equal
public java.lang.Object get(int index)
public java.lang.Comparable getFrom()
public java.lang.Comparable getTo()
protected java.lang.Object increment(java.lang.Object value)
public java.lang.String inspect()
public boolean isReverse()
public java.util.Iterator iterator()
public int size()
public void step(int step, Closure closure)
public java.util.List step(int step)
public java.util.List subList(int fromIndex, int toIndex)
public java.lang.String toString()
Groovy Documentation