org.paukov.combinatorics3.EmptyGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of combinatoricslib3 Show documentation
Show all versions of combinatoricslib3 Show documentation
Simple java library to generate permutations, combinations and other combinatorial sequences
The newest version!
package org.paukov.combinatorics3;
import java.util.Collections;
import java.util.Iterator;
import java.util.stream.Stream;
/**
* Always empty stub generator.
*/
class EmptyGenerator implements IGenerator {
private static final EmptyGenerator> EMPTY = new EmptyGenerator<>();
private EmptyGenerator() {
}
static EmptyGenerator emptyGenerator() {
@SuppressWarnings("unchecked")
EmptyGenerator g = (EmptyGenerator) EMPTY;
return g;
}
@Override
public Stream stream() {
return Stream.empty();
}
@Override
public Iterator iterator() {
return Collections.emptyIterator();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy