Class CyclicIntegerSequence

java.lang.Object
org.uma.jmetal.util.sequencegenerator.impl.CyclicIntegerSequence
All Implemented Interfaces:
SequenceGenerator<Integer>

public final class CyclicIntegerSequence extends Object implements SequenceGenerator<Integer>
A thread-safe implementation of SequenceGenerator that generates a cyclic sequence of integers from 0 (inclusive) to the specified size (exclusive). When the end of the sequence is reached, it wraps around to the beginning.

This implementation is thread-safe and can be safely used by multiple threads concurrently.

Example usage:


 SequenceGenerator<Integer> sequence = new CyclicIntegerSequence(5);
 // Will generate: 0, 1, 2, 3, 4, 0, 1, 2, ...
 
Author:
Antonio J. Nebro