|
|||||||||
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 Comparable |
at
The value at which the range originates (may be null ). |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
EmptyRange(Comparable at)
Creates a new EmptyRange . |
Method Summary | |
---|---|
boolean |
add(Object o)
Always throws UnsupportedOperationException for an empty range. |
boolean |
addAll(Collection c)
Always throws UnsupportedOperationException for an empty range. |
boolean |
addAll(int index,
Collection c)
Always throws UnsupportedOperationException for an empty range. |
boolean |
containsWithinBounds(Object o)
Never true for an empty range. |
Object |
get(int index)
Always throws IndexOutOfBoundsException for an empty range. |
Comparable |
getFrom()
The lower value in the range. |
Comparable |
getTo()
The upper value in the range. |
String |
inspect()
|
boolean |
isReverse()
Never true for an empty range. |
Object |
remove(int index)
Always throws UnsupportedOperationException for an empty range. |
boolean |
remove(Object o)
Always throws UnsupportedOperationException for an empty range. |
boolean |
removeAll(Collection c)
Always throws UnsupportedOperationException for an empty range. |
boolean |
retainAll(Collection c)
Always throws UnsupportedOperationException for an empty range. |
Object |
set(int index,
Object element)
Always throws UnsupportedOperationException for an empty range. |
int |
size()
Always 0 for an empty range. |
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. |
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 Comparable at
null
).
Constructor Detail |
---|
public EmptyRange(Comparable at)
EmptyRange
.
at
- the value at which the range starts (may be null
).Method Detail |
---|
public Comparable getFrom()
getFrom
in interface Range
public Comparable getTo()
getTo
in interface Range
public boolean isReverse()
isReverse
in interface Range
false
public boolean containsWithinBounds(Object o)
containsWithinBounds
in interface Range
o
- the object to check against the boundaries of the range
false
public String inspect()
inspect
in interface Range
String
representation of this Range
as would be typed into a console
to create the Range
instancepublic String toString()
toString
in class AbstractCollection
public int size()
size
in interface Collection
size
in interface List
size
in class AbstractCollection
public Object get(int index)
IndexOutOfBoundsException
for an empty range.
get
in interface List
get
in class AbstractList
IndexOutOfBoundsException
- alwayspublic boolean add(Object o)
UnsupportedOperationException
for an empty range.
add
in interface Collection
add
in interface List
add
in class AbstractList
UnsupportedOperationException
- alwayspublic boolean addAll(int index, Collection c)
UnsupportedOperationException
for an empty range.
addAll
in interface List
addAll
in class AbstractList
UnsupportedOperationException
public boolean addAll(Collection c)
UnsupportedOperationException
for an empty range.
addAll
in interface Collection
addAll
in interface List
addAll
in class AbstractCollection
UnsupportedOperationException
public boolean remove(Object o)
UnsupportedOperationException
for an empty range.
remove
in interface Collection
remove
in interface List
remove
in class AbstractCollection
UnsupportedOperationException
public Object remove(int index)
UnsupportedOperationException
for an empty range.
remove
in interface List
remove
in class AbstractList
UnsupportedOperationException
public boolean removeAll(Collection c)
UnsupportedOperationException
for an empty range.
removeAll
in interface Collection
removeAll
in interface List
removeAll
in class AbstractCollection
UnsupportedOperationException
public boolean retainAll(Collection c)
UnsupportedOperationException
for an empty range.
retainAll
in interface Collection
retainAll
in interface List
retainAll
in class AbstractCollection
UnsupportedOperationException
public Object set(int index, Object element)
UnsupportedOperationException
for an empty range.
set
in interface List
set
in class AbstractList
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 List step(int step)
step
in interface Range
step
- the amount by which to step. If negative, steps through the
range backwards.
|
Copyright © 2003-2009 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |