jlibs.core.graph.sequences
Class AbstractSequence<E>

java.lang.Object
  extended by jlibs.core.graph.sequences.AbstractSequence<E>
All Implemented Interfaces:
Sequence<E>
Direct Known Subclasses:
ArraySequence, ConcatSequence, DuplicateSequence, EnumeratedSequence, FilteredSequence, FilteredTreeSequence, IterableSequence, PathSequence, PreorderWalker, RepeatSequence

public abstract class AbstractSequence<E>
extends Object
implements Sequence<E>

Author:
Santhosh Kumar T

Field Summary
protected  Element<E> current
           
 
Constructor Summary
protected AbstractSequence()
           
 
Method Summary
 E current()
           
protected abstract  E findNext()
           
protected  Element<E> findNext(int count)
           
 boolean hasNext()
           
 int index()
           
 int length()
           
 E next()
           
 E next(int count)
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jlibs.core.graph.Sequence
copy
 

Field Detail

current

protected Element<E> current
Constructor Detail

AbstractSequence

protected AbstractSequence()
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Sequence<E>

next

public final E next()
Specified by:
next in interface Sequence<E>

next

public final E next(int count)
Specified by:
next in interface Sequence<E>

findNext

protected abstract E findNext()

findNext

protected Element<E> findNext(int count)

index

public int index()
Specified by:
index in interface Sequence<E>

current

public final E current()
Specified by:
current in interface Sequence<E>

length

public int length()
Specified by:
length in interface Sequence<E>

reset

public void reset()
Specified by:
reset in interface Sequence<E>


Copyright © 2018. All rights reserved.