org.eclipse.higgins.util.jscript
Class SingleObjectImmutableIterator

java.lang.Object
  extended byorg.eclipse.higgins.util.jscript.SingleObjectImmutableIterator
All Implemented Interfaces:
Iterator

public class SingleObjectImmutableIterator
extends Object
implements Iterator

Allows single objects to be viewed as an iterator This is a version of Iterator that overrides the remove method so that items can't be taken out of the bag.

Author:
dbuss@novell.com

Constructor Summary
SingleObjectImmutableIterator(Object obj)
          Create a new ImmutableIterator
 
Method Summary
 boolean hasNext()
          Standard hasNext method
 Object next()
          Standard next method
 void remove()
          Makes sure that no one can remove any elements from the collection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleObjectImmutableIterator

public SingleObjectImmutableIterator(Object obj)
Create a new ImmutableIterator

Method Detail

hasNext

public boolean hasNext()
Standard hasNext method

Specified by:
hasNext in interface Iterator

next

public Object next()
            throws NoSuchElementException
Standard next method

Specified by:
next in interface Iterator
Throws:
NoSuchElementException

remove

public void remove()
            throws UnsupportedOperationException
Makes sure that no one can remove any elements from the collection

Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException