com.varankin.io.stream
Class StreamCutter<Component extends Receiver<Part>,Part>

java.lang.Object
  extended by com.varankin.io.stream.StreamCutter<Component,Part>
All Implemented Interfaces:
java.lang.Iterable<Component>

public abstract class StreamCutter<Component extends Receiver<Part>,Part>
extends java.lang.Object
implements java.lang.Iterable<Component>

General purpose parser, trying to construct Component's from Part's. Where multiple options found, parser chooses Component with high priority, as indicated by provider of candidate parts. Parser starts consuming part(s) on using its iterator.

Author:
© 2009 Nikolai Varankine

Constructor Summary
StreamCutter(java.lang.Iterable<Part> aSource)
           
 
Method Summary
 java.util.Iterator<Component> iterator()
           
protected abstract  java.util.List<Component> next()
           
protected  java.util.List<Component> next(Component component)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamCutter

public StreamCutter(java.lang.Iterable<Part> aSource)
Parameters:
aSource - source of parts to construct component(s).
Method Detail

next

protected abstract java.util.List<Component> next()
Returns:
ordered sequence of new candidates to fill in, in descending priority. Null means no more candidates

next

protected java.util.List<Component> next(Component component)

iterator

public java.util.Iterator<Component> iterator()
Specified by:
iterator in interface java.lang.Iterable<Component extends Receiver<Part>>