Top Description Fields Constructors Methods
bsh.collection

public Class CollectionIterator

extends Object
implements BshIterator
Class Inheritance
All Implemented Interfaces
bsh.BshIterator
Imports
java.util.Iterator, .Collection, .Enumeration, java.lang.reflect.Array

This is the implementation of: BshIterator - a dynamically loaded extension that supports the collections API supported by JDK1.2 and greater.
Authors
Daniel Leuck, Pat Niemeyer

Field Summary

Modifier and TypeField and Description
private Iterator<E>

Constructor Summary

AccessConstructor and Description
public
CollectionIterator(Object
object over which we are iterating
iterateOverMe
)

Construct a basic CollectionIterator

Method Summary

Modifier and TypeMethod and Description
protected Iterator<E>

Returns:

an Iterator
createIterator
(Object
Object of type Iterator, Collection, or types supported by CollectionManager.BasicBshIterator
iterateOverMe
)

Create an iterator over the given object

public boolean

Returns:

The next object
hasNext
()

Implements bsh.BshIterator.hasNext.

Returns true if and only if there are more objects available via the next() method
public Object

Returns:

The next object
next
()

Implements bsh.BshIterator.next.

Fetch the next object in the iteration
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

iteratorback to summary
private Iterator<E> iterator

Constructor Detail

CollectionIteratorback to summary
public CollectionIterator(Object iterateOverMe)

Construct a basic CollectionIterator

Parameters
iterateOverMe:Object

object over which we are iterating

Exceptions
IllegalArgumentException:
If the argument is not a supported (i.e. iterable) type.
NullPointerException:
If the argument is null

Method Detail

createIteratorback to summary
protected Iterator<E> createIterator(Object iterateOverMe)

Create an iterator over the given object

Parameters
iterateOverMe:Object

Object of type Iterator, Collection, or types supported by CollectionManager.BasicBshIterator

Returns:Iterator<E>

an Iterator

Exceptions
IllegalArgumentException:
If the argument is not a supported (i.e. iterable) type.
NullPointerException:
If the argument is null
hasNextback to summary
public boolean hasNext()

Implements bsh.BshIterator.hasNext.

Returns true if and only if there are more objects available via the next() method

Returns:boolean

The next object

nextback to summary
public Object next()

Implements bsh.BshIterator.next.

Fetch the next object in the iteration

Returns:Object

The next object