Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.0
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## groovy.lang
Class EmptyRange

    java.lang.Object
      java.util.AbstractCollection
          java.util.AbstractList
              groovy.lang.EmptyRange

All Implemented Interfaces:
  Range

    class EmptyRange
    extends AbstractList

Constructing Ranges like 0..<0

author:
  Dierk Koenig

author:
  Edwin Tellman

Field Summary
`protected Comparable` | `at` The value at which the range originates (may be `null`).

Constructor Summary
`EmptyRange(Comparable at)` Creates a new {

Method Summary
`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()` {
`Comparable` | `getTo()` {
`String` | `inspect()` {
`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()` {

Methods inherited from class AbstractList
add, add, get, hashCode, indexOf, clear, equals, lastIndexOf, addAll, iterator, remove, set, listIterator, listIterator, subList, toString, contains, isEmpty, addAll, size, toArray, toArray, remove, containsAll, removeAll, retainAll, wait, wait, wait, getClass, notify, notifyAll, size

Methods inherited from class AbstractCollection
add, clear, toString, contains, isEmpty, addAll, iterator, size, toArray, toArray, remove, containsAll, removeAll, retainAll, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll

Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Field Detail

### at

    protected Comparable at

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

Constructor Detail

### EmptyRange

    public EmptyRange(Comparable at)

  Creates a new EmptyRange.
  param:
    at the value at which the range starts (may be `null`).

Method Detail

### add

    public boolean add(Object o)

  Always throws `UnsupportedOperationException` for an empty range.
  throws:
    UnsupportedOperationException always

### addAll

    public boolean addAll(int index, Collection c)

  Always throws `UnsupportedOperationException` for an empty range.
  throws:
    UnsupportedOperationException

### addAll

    public boolean addAll(Collection c)

  Always throws `UnsupportedOperationException` for an empty range.
  throws:
    UnsupportedOperationException

### containsWithinBounds

    public boolean containsWithinBounds(Object o)

  Never true for an empty range.
  return:
    `false`

### get

    public Object get(int index)

  Always throws `IndexOutOfBoundsException` for an empty range.
  throws:
    IndexOutOfBoundsException always

### getFrom

    public Comparable getFrom()

  {@inheritDoc}

### getTo

    public Comparable getTo()

  {@inheritDoc}

### inspect

    public String inspect()

  {@inheritDoc}

### isReverse

    public boolean isReverse()

  Never true for an empty range.
  return:
    `false`

### remove

    public boolean remove(Object o)

  Always throws `UnsupportedOperationException` for an empty range.
  throws:
    UnsupportedOperationException

### remove

    public Object remove(int index)

  Always throws `UnsupportedOperationException` for an empty range.
  throws:
    UnsupportedOperationException

### removeAll

    public boolean removeAll(Collection c)

  Always throws `UnsupportedOperationException` for an empty range.
  throws:
    UnsupportedOperationException

### retainAll

    public boolean retainAll(Collection c)

  Always throws `UnsupportedOperationException` for an empty range.
  throws:
    UnsupportedOperationException

### set

    public Object set(int index, Object element)

  Always throws `UnsupportedOperationException` for an empty range.
  throws:
    UnsupportedOperationException

### size

    public int size()

  Always 0 for an empty range.
  return:
    0

### step

    public void step(int step, Closure closure)

  Always does nothing for an empty range.

### step

    public List step(int step)

  Always returns an empty list for an empty range.

### toString

    public String toString()

  {@inheritDoc}

Copyright © 2003-2009 The Codehaus. All rights reserved.