net.sf.mmm.util.collection.base
Class SingleElementIterator<E>

java.lang.Object
  extended by net.sf.mmm.util.collection.base.SingleElementIterator<E>
Type Parameters:
E - is the templated type of the elements to iterate.
All Implemented Interfaces:
Iterator<E>

public class SingleElementIterator<E>
extends Object
implements Iterator<E>

This is an implementation of the Iterator interface that iterates a single element.

Since:
1.0.2
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  E element
          The single element to iterate.
 
Constructor Summary
SingleElementIterator(E element)
          The constructor.
 
Method Summary
 boolean hasNext()
          
 E next()
          
 void remove()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

element

private E element
The single element to iterate.

Constructor Detail

SingleElementIterator

public SingleElementIterator(E element)
The constructor.

Parameters:
element - is the single element to iterate. If null the iterator will be entirely empty.
Method Detail

hasNext

public boolean hasNext()

Specified by:
hasNext in interface Iterator<E>

next

public E next()

Specified by:
next in interface Iterator<E>

remove

public void remove()

Specified by:
remove in interface Iterator<E>


Copyright © 2001-2010 mmm-Team. All Rights Reserved.