|
|||||||||
| 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 Rangepublic Comparable getTo()
getTo in interface Rangepublic boolean isReverse()
isReverse in interface Rangefalsepublic boolean containsWithinBounds(Object o)
containsWithinBounds in interface Rangeo - the object to check against the boundaries of the range
falsepublic String inspect()
inspect in interface RangeString representation of this Range as would be typed into a console
to create the Range instancepublic String toString()
toString in class AbstractCollectionpublic int size()
size in interface Collectionsize in interface Listsize in class AbstractCollectionpublic Object get(int index)
IndexOutOfBoundsException for an empty range.
get in interface Listget in class AbstractListIndexOutOfBoundsException - alwayspublic boolean add(Object o)
UnsupportedOperationException for an empty range.
add in interface Collectionadd in interface Listadd in class AbstractListUnsupportedOperationException - always
public boolean addAll(int index,
Collection c)
UnsupportedOperationException for an empty range.
addAll in interface ListaddAll in class AbstractListUnsupportedOperationExceptionpublic boolean addAll(Collection c)
UnsupportedOperationException for an empty range.
addAll in interface CollectionaddAll in interface ListaddAll in class AbstractCollectionUnsupportedOperationExceptionpublic boolean remove(Object o)
UnsupportedOperationException for an empty range.
remove in interface Collectionremove in interface Listremove in class AbstractCollectionUnsupportedOperationExceptionpublic Object remove(int index)
UnsupportedOperationException for an empty range.
remove in interface Listremove in class AbstractListUnsupportedOperationExceptionpublic boolean removeAll(Collection c)
UnsupportedOperationException for an empty range.
removeAll in interface CollectionremoveAll in interface ListremoveAll in class AbstractCollectionUnsupportedOperationExceptionpublic boolean retainAll(Collection c)
UnsupportedOperationException for an empty range.
retainAll in interface CollectionretainAll in interface ListretainAll in class AbstractCollectionUnsupportedOperationException
public Object set(int index,
Object element)
UnsupportedOperationException for an empty range.
set in interface Listset in class AbstractListUnsupportedOperationException
public void step(int step,
Closure closure)
step in interface Rangestep - 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 Rangestep - 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 | ||||||||