com.espertech.esper.collection
Class SingleObjectIterator<T>

java.lang.Object
  extended by com.espertech.esper.collection.SingleObjectIterator<T>
All Implemented Interfaces:
java.util.Iterator<T>

public class SingleObjectIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>

A utility class for an iterator that has zero or one element and can be reset with a new value.


Constructor Summary
SingleObjectIterator()
          Ctor for an iterator starting out empty.
SingleObjectIterator(T object)
          Constructor, takes the single object to iterate over as a parameter.
 
Method Summary
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleObjectIterator

public SingleObjectIterator(T object)
Constructor, takes the single object to iterate over as a parameter. The single object can be null indicating that there are no more elements.

Parameters:
object - single object that the iterator returns, or null for an empty iterator

SingleObjectIterator

public SingleObjectIterator()
Ctor for an iterator starting out empty.

Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<T>

next

public T next()
Specified by:
next in interface java.util.Iterator<T>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<T>

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com