edu.umass.cs.mallet.base.pipe.iterator
Class InstanceListIterator

java.lang.Object
  extended byedu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
      extended byedu.umass.cs.mallet.base.pipe.iterator.InstanceListIterator
All Implemented Interfaces:
java.util.Iterator, PipeInputIterator

public class InstanceListIterator
extends AbstractPipeInputIterator

This method feeds a pipeline from another InstanceList. The new instances will have their pipe set to the pipe this iterates into, and will carry no record of their previous origin. New instance objects will be created; the originals are not modified.

This must be used with caution, for it can result in accidentally piping the same instances through the same pipe twice, something that MALLET otherwise tries to protect you from.

To save memory, in the future we might add a flag that (if set) would cause this to remove the original instances from the InstanceList.

Created: Oct 31, 2004


Field Summary
 
Fields inherited from class edu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
parentInstance
 
Constructor Summary
InstanceListIterator(InstanceList source)
           
 
Method Summary
 boolean hasNext()
           
 Instance nextInstance()
           
 
Methods inherited from class edu.umass.cs.mallet.base.pipe.iterator.AbstractPipeInputIterator
next, remove, setParentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstanceListIterator

public InstanceListIterator(InstanceList source)
Method Detail

nextInstance

public Instance nextInstance()
Specified by:
nextInstance in interface PipeInputIterator
Specified by:
nextInstance in class AbstractPipeInputIterator

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
Specified by:
hasNext in class AbstractPipeInputIterator