public class EmptyRange<T extends Comparable> extends AbstractList implements Range
Constructing Ranges like 0..<0
Modifiers | Name | Description |
---|---|---|
protected T |
at |
The value at which the range originates (may be null ). |
Constructor and description |
---|
EmptyRange(T at) Creates a new EmptyRange. |
Type Params | Return Type | Name and description |
---|---|---|
|
public boolean |
add(T o) Always throws UnsupportedOperationException for an empty range. |
|
public boolean |
addAll(int index, Collection<? extends T> c) Always throws UnsupportedOperationException for an empty range. |
|
public boolean |
addAll(Collection<? extends T> c) Always throws UnsupportedOperationException for an empty range. |
|
public boolean |
containsWithinBounds(Object o) Never true for an empty range. |
|
public T |
get(int index) Always throws IndexOutOfBoundsException for an empty range. |
|
public T |
getFrom() {@inheritDoc} |
|
public T |
getTo() {@inheritDoc} |
|
public String |
inspect() {@inheritDoc} |
|
public boolean |
isReverse() Never true for an empty range. |
|
public boolean |
remove(Object o) Always throws UnsupportedOperationException for an empty range. |
|
public T |
remove(int index) Always throws UnsupportedOperationException for an empty range. |
|
public boolean |
removeAll(Collection<?> c) Always throws UnsupportedOperationException for an empty range. |
|
public boolean |
retainAll(Collection<?> c) Always throws UnsupportedOperationException for an empty range. |
|
public T |
set(int index, T element) Always throws UnsupportedOperationException for an empty range. |
|
public int |
size() Always 0 for an empty range. |
|
public void |
step(int step, Closure closure) Always does nothing for an empty range. |
|
public List<T> |
step(int step) Always returns an empty list for an empty range. |
|
public String |
toString() {@inheritDoc} |
Methods inherited from class | Name |
---|---|
class AbstractList |
add, add, remove, get, equals, hashCode, indexOf, clear, lastIndexOf, subList, iterator, addAll, set, listIterator, listIterator, remove, toString, isEmpty, size, toArray, toArray, contains, addAll, removeAll, retainAll, containsAll, wait, wait, wait, getClass, notify, notifyAll, toArray, stream, spliterator, removeIf, parallelStream, forEach, replaceAll, sort |
Creates a new EmptyRange.
at
- the value at which the range starts (may be null
). Always throws UnsupportedOperationException
for an empty range.
Always throws UnsupportedOperationException
for an empty range.
Always throws UnsupportedOperationException
for an empty range.
Always throws IndexOutOfBoundsException
for an empty range.
{@inheritDoc}
{@inheritDoc}
Never true for an empty range.
false
Always throws UnsupportedOperationException
for an empty range.
Always throws UnsupportedOperationException
for an empty range.
Always throws UnsupportedOperationException
for an empty range.
Always throws UnsupportedOperationException
for an empty range.
Always throws UnsupportedOperationException
for an empty range.
Always 0 for an empty range.
Copyright © 2003-2024 The Apache Software Foundation. All rights reserved.