|
Groovy 2.2.0 | |||||||
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 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(Comparable from, Comparable to)
Creates a new ObjectRange. |
|
ObjectRange(Comparable from, Comparable to, boolean reverse)
|
Method Summary | |
---|---|
boolean
|
contains(Object value)
|
boolean
|
containsWithinBounds(Object value)
Checks whether a value is between the from and to values of a Range |
protected Object
|
decrement(Object value)
|
boolean
|
equals(Object that)
{@inheritDoc} |
boolean
|
equals(ObjectRange that)
Compares an ObjectRange to another ObjectRange. |
Object
|
get(int index)
{@inheritDoc} |
Comparable
|
getFrom()
{@inheritDoc} |
Comparable
|
getTo()
{@inheritDoc} |
protected Object
|
increment(Object value)
|
String
|
inspect()
|
boolean
|
isReverse()
{@inheritDoc} |
Iterator
|
iterator()
{@inheritDoc} |
int
|
size()
{@inheritDoc} |
void
|
step(int step, Closure closure)
{@inheritDoc} |
List
|
step(int step)
{@inheritDoc} |
List
|
subList(int fromIndex, int toIndex)
{@inheritDoc} |
String
|
toString()
{@inheritDoc} |
Methods inherited from class AbstractList | |
---|---|
add, add, remove, get, equals, hashCode, indexOf, clear, lastIndexOf, subList, addAll, iterator, set, listIterator, listIterator, remove, toString, contains, isEmpty, size, toArray, toArray, addAll, retainAll, containsAll, removeAll, wait, wait, wait, getClass, notify, notifyAll, size |
Methods inherited from class AbstractCollection | |
---|---|
add, remove, toString, clear, contains, isEmpty, size, toArray, toArray, addAll, iterator, retainAll, containsAll, removeAll, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll |
Constructor Detail |
---|
public ObjectRange(Comparable from, Comparable to)
from
< to
.
from
- the first value in the range.to
- the last value in the range.
public ObjectRange(Comparable from, Comparable to, boolean reverse)
Method Detail |
---|
public boolean contains(Object value)
public boolean containsWithinBounds(Object value)
value
- the value of interest
protected Object decrement(Object value)
public boolean equals(Object that)
public boolean equals(ObjectRange that)
that
- the object to check equality withtrue
if the ranges are equal
public Object get(int index)
public Comparable getFrom()
public Comparable getTo()
protected Object increment(Object value)
public String inspect()
public boolean isReverse()
public Iterator iterator()
public int size()
public void step(int step, Closure closure)
public List step(int step)
public List subList(int fromIndex, int toIndex)
public String toString()
Copyright © 2003-2013 The Codehaus. All rights reserved.