Combinations API combinations-70 (20111029231334)

edu.cornell.med.icb.combinations
Class Combination<E>

java.lang.Object
  extended by edu.cornell.med.icb.combinations.Combination<E>

public final class Combination<E>
extends Object

Author:
Fabien Campagne Date: Apr 8, 2005 Time: 3:20:16 PM

Constructor Summary
Combination(int n, int k)
           
 
Method Summary
 Combination<E> another(Random random, Set<Combination<E>> previousCombinations, long maxCombinations)
          Finds another random combination.
 void applyComplementTo(List<E> source, List<E> result)
           
 void applyTo(E[] source, E[] result)
           
 void applyTo(List<E> source, List<E> result)
           
static long choose(long n, long k)
          Return the number of times a different set of k elements can be choosen from n elements.
 boolean equals(Object obj)
           
 int hashCode()
           
 Combination<E> next()
           
 Combination<E> skip(long s)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Combination

public Combination(int n,
                   int k)
Method Detail

choose

public static long choose(long n,
                          long k)
Return the number of times a different set of k elements can be choosen from n elements.

Parameters:
n - Size of the set to choose from
k - Size of the set to fill
Returns:
Combination(n,k).

next

public Combination<E> next()

skip

public Combination<E> skip(long s)

another

public Combination<E> another(Random random,
                              Set<Combination<E>> previousCombinations,
                              long maxCombinations)
Finds another random combination.

Parameters:
previousCombinations - Set of previous combinations that this combination should not be identical to.
Returns:
another random combination.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

applyTo

public void applyTo(E[] source,
                    E[] result)

applyTo

public void applyTo(List<E> source,
                    List<E> result)

applyComplementTo

public void applyComplementTo(List<E> source,
                              List<E> result)

Combinations API combinations-70 (20111029231334)

Copyright © 2006-2011 Institute for Computational Biomedicine, All Rights Reserved.