com.varankin.io.stream
Class Marker<T>

java.lang.Object
  extended by com.varankin.io.stream.Marker<T>
All Implemented Interfaces:
java.lang.Iterable<Marker.Box<T>>

public final class Marker<T>
extends java.lang.Object
implements java.lang.Iterable<Marker.Box<T>>

Iterable passthrough object that wraps incoming objects into container marked with structured location. Indices of location are limited by value of Long.MAX_VALUE.

Author:
© 2010 Nikolai Varankine

Nested Class Summary
static class Marker.Box<Unit>
          Container to wrap incoming object.
 
Constructor Summary
Marker(java.lang.Iterable<T> aSource, T... aBreakers)
           
 
Method Summary
 java.util.Iterator<Marker.Box<T>> iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Marker

public Marker(java.lang.Iterable<T> aSource,
              T... aBreakers)
Parameters:
aSource - provider of incoming objects.
aBreakers - patterns of incoming objects to form ranks of location counters; when incoming object equals some pattern, it increases correspondent counter and resets all lowest counters to zero.
Method Detail

iterator

public java.util.Iterator<Marker.Box<T>> iterator()
Specified by:
iterator in interface java.lang.Iterable<Marker.Box<T>>