| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Comparable |
at
The value at which the range originates (may be
null). |
| Constructor and Description |
|---|
EmptyRange(java.lang.Comparable at)
Creates a new
EmptyRange. |
| Modifier and Type | Method and Description |
|---|---|
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() |
add, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListcontains, containsAll, isEmpty, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitprotected java.lang.Comparable at
null).public EmptyRange(java.lang.Comparable at)
EmptyRange.at - the value at which the range starts (may be null).public java.lang.Comparable getFrom()
public java.lang.Comparable getTo()
public boolean isReverse()
public boolean containsWithinBounds(java.lang.Object o)
containsWithinBounds in interface Rangeo - the object to check against the boundaries of the rangefalsepublic java.lang.String inspect()
public java.lang.String toString()
toString in class java.util.AbstractCollectionpublic int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.AbstractCollectionpublic java.lang.Object get(int index)
IndexOutOfBoundsException for an empty range.get in interface java.util.Listget in class java.util.AbstractListjava.lang.IndexOutOfBoundsException - alwayspublic boolean add(java.lang.Object o)
UnsupportedOperationException for an empty range.add in interface java.util.Collectionadd in interface java.util.Listadd in class java.util.AbstractListjava.lang.UnsupportedOperationException - alwayspublic boolean addAll(int index,
java.util.Collection c)
UnsupportedOperationException for an empty range.addAll in interface java.util.ListaddAll in class java.util.AbstractListjava.lang.UnsupportedOperationExceptionpublic boolean addAll(java.util.Collection c)
UnsupportedOperationException for an empty range.addAll in interface java.util.CollectionaddAll in interface java.util.ListaddAll in class java.util.AbstractCollectionjava.lang.UnsupportedOperationExceptionpublic boolean remove(java.lang.Object o)
UnsupportedOperationException for an empty range.remove in interface java.util.Collectionremove in interface java.util.Listremove in class java.util.AbstractCollectionjava.lang.UnsupportedOperationExceptionpublic java.lang.Object remove(int index)
UnsupportedOperationException for an empty range.remove in interface java.util.Listremove in class java.util.AbstractListjava.lang.UnsupportedOperationExceptionpublic boolean removeAll(java.util.Collection c)
UnsupportedOperationException for an empty range.removeAll in interface java.util.CollectionremoveAll in interface java.util.ListremoveAll in class java.util.AbstractCollectionjava.lang.UnsupportedOperationExceptionpublic boolean retainAll(java.util.Collection c)
UnsupportedOperationException for an empty range.retainAll in interface java.util.CollectionretainAll in interface java.util.ListretainAll in class java.util.AbstractCollectionjava.lang.UnsupportedOperationExceptionpublic java.lang.Object set(int index,
java.lang.Object element)
UnsupportedOperationException for an empty range.set in interface java.util.Listset in class java.util.AbstractListjava.lang.UnsupportedOperationExceptionpublic void step(int step,
Closure closure)
public java.util.List step(int step)