edu.iu.cnets.klatsch.stream
Class SWrapperIterator

java.lang.Object
  extended by edu.iu.cnets.klatsch.stream.Stream
      extended by edu.iu.cnets.klatsch.stream.SIterator
          extended by edu.iu.cnets.klatsch.stream.SWrapperIterator

public class SWrapperIterator
extends SIterator

This class wraps a stream around an iterator over non-Klatsch values. For the class to work successfully, the given value class must be a subclass of Value and have a single-argument constructor that takes a single value of the same type as the iterator.


Field Summary
(package private)  java.lang.Class<? extends Value> wrapperClass
           
 
Fields inherited from class edu.iu.cnets.klatsch.stream.SIterator
iter
 
Fields inherited from class edu.iu.cnets.klatsch.stream.Stream
buffer
 
Constructor Summary
SWrapperIterator(java.lang.Class<? extends Value> wrapperClass, java.util.Iterator<?> iter)
          Builds a new stream from the given iterator.
 
Method Summary
 Value getNext()
          Gets the next value in the list, if possible.
 
Methods inherited from class edu.iu.cnets.klatsch.stream.SIterator
done, toString
 
Methods inherited from class edu.iu.cnets.klatsch.stream.Stream
current, get
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

wrapperClass

java.lang.Class<? extends Value> wrapperClass
Constructor Detail

SWrapperIterator

public SWrapperIterator(java.lang.Class<? extends Value> wrapperClass,
                        java.util.Iterator<?> iter)
Builds a new stream from the given iterator. The individual elements will be wrapped in the given class, which should be a subclass of Value.

Method Detail

getNext

public Value getNext()
              throws EvaluationException
Gets the next value in the list, if possible.

Overrides:
getNext in class SIterator
Returns:
the value
Throws:
EvaluationException