Class RDBERule.Combinations

java.lang.Object
org.openscience.cdk.formula.rules.RDBERule.Combinations
Enclosing class:
RDBERule

public class RDBERule.Combinations extends Object
  • Constructor Details

    • Combinations

      public Combinations(Object[] inArray, int m)
      Create a Combination to enumerate through all subsets of the supplied Object array, selecting m at a time.
      Parameters:
      inArray - the group to choose from
      m - int the number to select in each choice
  • Method Details

    • hasMoreElements

      public boolean hasMoreElements()
      Returns:
      true, unless we have already returned the last combination.
    • nextElement

      public Object nextElement()
      Returns:
      java.lang.Object, the next combination from the supplied Object array.

      Actually, an array of Objects is returned. The declaration must say just Object, because the Combinations class implements Enumeration, which declares that the nextElement() returns a plain Object. Users must cast the returned object to (Object[]).