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, subList
contains, containsAll, isEmpty, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
protected 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 Range
o
- the object to check against the boundaries of the rangefalse
public java.lang.String inspect()
public 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)
public java.util.List step(int step)