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

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

/*
  Combinatorics Library 3
  Copyright 2009-2016 Dmytro Paukov [email protected]
 */
package org.paukov.combinatorics3;

import java.util.Collection;
import java.util.List;

/**
 * A generator for iterating over the combinations.
 * @param  Type of the elements in the combinations.
 */
public class CombinationGenerator {

  final Collection originalVector;

  CombinationGenerator(Collection originalVector) {
    this.originalVector = originalVector;
  }

  public IGenerator> simple(int length) {
    return new SimpleCombinationGenerator<>(originalVector, length);
  }

  public IGenerator> multi(int length) {
    return new MultiCombinationGenerator<>(originalVector, length);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy