|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList
groovy.lang.EmptyRange
public class EmptyRange
Constructing Ranges like 0..<0
Field Summary | |
---|---|
protected java.lang.Comparable |
at
The value at which the range originates (may be null ). |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
EmptyRange(java.lang.Comparable at)
Creates a new EmptyRange . |
Method Summary | |
---|---|
boolean |
add(java.lang.Object o)
Always throws UnsupportedOperationException for an empty range. |
boolean |
addAll(java.util.Collection c)
Always throws UnsupportedOperationException for an empty range. |
boolean |
addAll(int index,
java.util.Collection c)
Always throws UnsupportedOperationException for an empty range. |
boolean |
containsWithinBounds(java.lang.Object o)
Never true for an empty range. |
java.lang.Object |
get(int index)
Always throws IndexOutOfBoundsException for an empty range. |
java.lang.Comparable |
getFrom()
The lower value in the range. |
java.lang.Comparable |
getTo()
The upper value in the range. |
java.lang.String |
inspect()
|
boolean |
isReverse()
Never true for an empty range. |
java.lang.Object |
remove(int index)
Always throws UnsupportedOperationException for an empty range. |
boolean |
remove(java.lang.Object o)
Always throws UnsupportedOperationException for an empty range. |
boolean |
removeAll(java.util.Collection c)
Always throws UnsupportedOperationException for an empty range. |
boolean |
retainAll(java.util.Collection c)
Always throws UnsupportedOperationException for an empty range. |
java.lang.Object |
set(int index,
java.lang.Object element)
Always throws UnsupportedOperationException for an empty range. |
int |
size()
Always 0 for an empty range. |
java.util.List |
step(int step)
Always returns an empty list for an empty range. |
void |
step(int step,
Closure closure)
Always does nothing for an empty range. |
java.lang.String |
toString()
|
Methods inherited from class java.util.AbstractList |
---|
add, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
contains, containsAll, isEmpty, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
add, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, subList, toArray, toArray |
Field Detail |
---|
protected java.lang.Comparable at
null
).
Constructor Detail |
---|
public EmptyRange(java.lang.Comparable at)
EmptyRange
.
at
- the value at which the range starts (may be null
).Method Detail |
---|
public java.lang.Comparable getFrom()
getFrom
in interface Range
public java.lang.Comparable getTo()
getTo
in interface Range
public boolean isReverse()
isReverse
in interface Range
false
public boolean containsWithinBounds(java.lang.Object o)
containsWithinBounds
in interface Range
o
- the object to check against the boundaries of the range
false
public java.lang.String inspect()
inspect
in interface Range
String
representation of this Range
as would be typed into a console
to create the Range
instancepublic java.lang.String toString()
toString
in class java.util.AbstractCollection
public int size()
size
in interface java.util.Collection
size
in interface java.util.List
size
in class java.util.AbstractCollection
public java.lang.Object get(int index)
IndexOutOfBoundsException
for an empty range.
get
in interface java.util.List
get
in class java.util.AbstractList
java.lang.IndexOutOfBoundsException
- alwayspublic boolean add(java.lang.Object o)
UnsupportedOperationException
for an empty range.
add
in interface java.util.Collection
add
in interface java.util.List
add
in class java.util.AbstractList
java.lang.UnsupportedOperationException
- alwayspublic boolean addAll(int index, java.util.Collection c)
UnsupportedOperationException
for an empty range.
addAll
in interface java.util.List
addAll
in class java.util.AbstractList
java.lang.UnsupportedOperationException
public boolean addAll(java.util.Collection c)
UnsupportedOperationException
for an empty range.
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.AbstractCollection
java.lang.UnsupportedOperationException
public boolean remove(java.lang.Object o)
UnsupportedOperationException
for an empty range.
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in class java.util.AbstractCollection
java.lang.UnsupportedOperationException
public java.lang.Object remove(int index)
UnsupportedOperationException
for an empty range.
remove
in interface java.util.List
remove
in class java.util.AbstractList
java.lang.UnsupportedOperationException
public boolean removeAll(java.util.Collection c)
UnsupportedOperationException
for an empty range.
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in class java.util.AbstractCollection
java.lang.UnsupportedOperationException
public boolean retainAll(java.util.Collection c)
UnsupportedOperationException
for an empty range.
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in class java.util.AbstractCollection
java.lang.UnsupportedOperationException
public java.lang.Object set(int index, java.lang.Object element)
UnsupportedOperationException
for an empty range.
set
in interface java.util.List
set
in class java.util.AbstractList
java.lang.UnsupportedOperationException
public void step(int step, Closure closure)
step
in interface Range
step
- the amount by which to step. If negative, steps through the
range backwards.closure
- the Closure
to callpublic java.util.List step(int step)
step
in interface Range
step
- the amount by which to step. If negative, steps through the
range backwards.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |