Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.collections.primitives.adapters
Class IteratorShortIterator

    java.lang.Object
      org.apache.commons.collections.primitives.adapters.IteratorShortIterator

All Implemented Interfaces:
  ShortIterator

public class IteratorShortIterator
extends Object
implements ShortIterator

Adapts a `Number`-valued `Iterator` to the `ShortIterator` interface.

This implementation delegates most methods to the provided `Iterator` implementation in the "obvious" way.

Since:
  Commons Primitives 1.0
Version:
  $Revision: 1.3 $ $Date: 2003/10/16 20:49:38 $
Author:
  Rodney Waldhoff

Constructor Summary
`IteratorShortIterator(Iterator iterator)` Creates an `ShortIterator` wrapping the specified `Iterator`.

Method Summary
`boolean` | `hasNext()` Returns `true` iff I have more elements.
`short` | `next()` Returns the next element in me.
`void` | `remove()` Removes from my underlying collection the last element `returned` by me (optional operation).
`static ShortIterator` | `wrap(Iterator iterator)` Create an `ShortIterator` wrapping the specified `Iterator`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### IteratorShortIterator

    public IteratorShortIterator(Iterator iterator)

  Creates an `ShortIterator` wrapping the specified `Iterator`.

See Also:
  `wrap(java.util.Iterator)`

Method Detail

### wrap

    public static ShortIterator wrap(Iterator iterator)

  Create an `ShortIterator` wrapping the specified `Iterator`. When the given iterator is `null`, returns `null`.

  Parameters:
    `iterator` - the (possibly `null`) `Iterator` to wrap
  Returns:
    an `ShortIterator` wrapping the given iterator, or `null` when iterator is `null`.

### hasNext

    public boolean hasNext()

  Description copied from interface: `ShortIterator`
  Returns `true` iff I have more elements. (In other words, returns `true` iff a subsequent call to `next` will return an element rather than throwing an exception.)

  Specified by:
    `hasNext` in interface `ShortIterator`
  Returns:
    `true` iff I have more elements

### next

    public short next()

  Description copied from interface: `ShortIterator`
  Returns the next element in me.

  Specified by:
    `next` in interface `ShortIterator`
  Returns:
    the next element in me

### remove

    public void remove()

  Description copied from interface: `ShortIterator`
  Removes from my underlying collection the last element `returned` by me (optional operation).

  Specified by:
    `remove` in interface `ShortIterator`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2003 Apache Software Foundation. All Rights Reserved.