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

java.lang.Object
  extended by jlibs.core.graph.sequences.AbstractSequence<E>
      extended by jlibs.core.graph.sequences.RepeatSequence<E>
All Implemented Interfaces:
Sequence<E>

public class RepeatSequence<E>
extends AbstractSequence<E>

A Sequence that can repeat given sequence specified number of times

Author:
Santhosh Kumar T

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

Constructor Detail

RepeatSequence

public RepeatSequence(Sequence<E> sequence,
                      int count)
Method Detail

findNext

protected E findNext()
Specified by:
findNext in class AbstractSequence<E>

reset

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

copy

public RepeatSequence<E> copy()

length

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


Copyright © 2018. All rights reserved.