Package: groovy.lang

## [Java] Class EmptyRange

- groovy.lang.EmptyRange

- All Implemented Interfaces and Traits:
    Range

      public class EmptyRange
      extends AbstractList

  Constructing Ranges like 0..<0

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected Comparable` | `at` | The value at which the range originates (may be `null`).

  - ### Constructor Summary

    Constructors
    Constructor and description
    `EmptyRange (Comparable at)` Creates a new EmptyRange.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `boolean` | `add(Object o)` Always throws `UnsupportedOperationException` for an empty range.
    `` | `boolean` | `addAll(int index, Collection c)` Always throws `UnsupportedOperationException` for an empty range.
    `` | `boolean` | `addAll(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()` {@inheritDoc}
    `` | `Comparable` | `getTo()` {@inheritDoc}
    `` | `String` | `inspect()` {@inheritDoc}
    `` | `boolean` | `isReverse()` Never true for an empty range.
    `` | `boolean` | `remove(Object o)` Always throws `UnsupportedOperationException` for an empty range.
    `` | `Object` | `remove(int index)` 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.
    `` | `void` | `step(int step, Closure closure)` Always does nothing for an empty range.
    `` | `List` | `step(int step)` Always returns an empty list for an empty range.
    `` | `String` | `toString()` {@inheritDoc}

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---

    `class AbstractList`

    `remove, get, equals, hashCode, indexOf, clear, lastIndexOf, add, add, subList, iterator, addAll, set, listIterator, listIterator, remove, size, toString, isEmpty, toArray, toArray, contains, addAll, removeAll, retainAll, containsAll, getClass, notify, notifyAll, wait, wait, wait, toArray, stream, spliterator, removeIf, parallelStream, forEach, replaceAll, sort, getFirst, getLast, addFirst, addLast, removeFirst, removeLast, reversed, reversed`

    `class AbstractCollection` | `remove, size, toString, clear, isEmpty, add, toArray, toArray, iterator, contains, addAll, removeAll, retainAll, containsAll, equals, hashCode, getClass, notify, notifyAll, wait, wait, wait, toArray, stream, spliterator, removeIf, parallelStream, forEach`

- - ### Field Detail

    - #### protected Comparable at

      The value at which the range originates (may be `null`).

  - ### Constructor Detail

    - #### public EmptyRange(Comparable at)

      Creates a new EmptyRange.

      Parameters:
        `at` - the value at which the range starts (may be `null`).

  - ### Method Detail

    - #### @Override public boolean add(Object o)

      Always throws `UnsupportedOperationException` for an empty range.

      throws:
        UnsupportedOperationException always

    - #### @Override public boolean addAll(int index, Collection c)

      Always throws `UnsupportedOperationException` for an empty range.

      throws:
        UnsupportedOperationException

    - #### @Override public boolean addAll(Collection c)

      Always throws `UnsupportedOperationException` for an empty range.

      throws:
        UnsupportedOperationException

    - #### @Override public boolean containsWithinBounds(Object o)

      Never true for an empty range.

      Returns:
        `false`

    - #### @Override public Object get(int index)

      Always throws `IndexOutOfBoundsException` for an empty range.

      throws:
        IndexOutOfBoundsException always

    - #### @Override public Comparable getFrom()

      {@inheritDoc}

    - #### @Override public Comparable getTo()

      {@inheritDoc}

    - #### @Override public String inspect()

      {@inheritDoc}

    - #### @Override public boolean isReverse()

      Never true for an empty range.

      Returns:
        `false`

    - #### @Override public boolean remove(Object o)

      Always throws `UnsupportedOperationException` for an empty range.

      throws:
        UnsupportedOperationException

    - #### @Override public Object remove(int index)

      Always throws `UnsupportedOperationException` for an empty range.

      throws:
        UnsupportedOperationException

    - #### @Override public boolean removeAll(Collection c)

      Always throws `UnsupportedOperationException` for an empty range.

      throws:
        UnsupportedOperationException

    - #### @Override public boolean retainAll(Collection c)

      Always throws `UnsupportedOperationException` for an empty range.

      throws:
        UnsupportedOperationException

    - #### @Override public Object set(int index, Object element)

      Always throws `UnsupportedOperationException` for an empty range.

      throws:
        UnsupportedOperationException

    - #### @Override public int size()

      Always 0 for an empty range.

      Returns:
        0

    - #### @Override public void step(int step, Closure closure)

      Always does nothing for an empty range.

    - #### @Override public List step(int step)

      Always returns an empty list for an empty range.

    - #### public String toString()

      {@inheritDoc}