Class RearrangerSample<T>
- java.lang.Object
-
- ru.ispras.microtesk.test.sequence.rearranger.RearrangerSample<T>
-
- Type Parameters:
T
- Sequence item type.
- All Implemented Interfaces:
Rearranger<T>
,ru.ispras.testbase.knowledge.iterator.Iterator<java.util.List<T>>
public final class RearrangerSample<T> extends java.lang.Object implements Rearranger<T>
TheRearrangerSample
rearranger samples the sequences returned by the original iterator in a random manner.Logic is the following.
N
sequences are selected at random from the original collection of sequences.N
is a random number between 0 andS
, whereS
is the number of original sequences. The relative order of selected sequences is preserved.
-
-
Constructor Summary
Constructors Constructor Description RearrangerSample()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RearrangerSample<T>
clone()
boolean
hasValue()
void
init()
void
initialize(ru.ispras.testbase.knowledge.iterator.Iterator<java.util.List<T>> original)
void
next()
void
stop()
java.util.List<T>
value()
-
-
-
Method Detail
-
initialize
public void initialize(ru.ispras.testbase.knowledge.iterator.Iterator<java.util.List<T>> original)
- Specified by:
initialize
in interfaceRearranger<T>
-
init
public void init()
- Specified by:
init
in interfaceru.ispras.testbase.knowledge.iterator.Iterator<T>
-
hasValue
public boolean hasValue()
- Specified by:
hasValue
in interfaceru.ispras.testbase.knowledge.iterator.Iterator<T>
-
value
public java.util.List<T> value()
- Specified by:
value
in interfaceru.ispras.testbase.knowledge.iterator.Iterator<T>
-
next
public void next()
- Specified by:
next
in interfaceru.ispras.testbase.knowledge.iterator.Iterator<T>
-
stop
public void stop()
- Specified by:
stop
in interfaceru.ispras.testbase.knowledge.iterator.Iterator<T>
-
clone
public RearrangerSample<T> clone()
- Specified by:
clone
in interfaceru.ispras.testbase.knowledge.iterator.Iterator<T>
- Overrides:
clone
in classjava.lang.Object
-
-