All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.paukov.combinatorics3.EmptyGenerator Maven / Gradle / Ivy

Go to download

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