Code example for BitSet

Methods: and

0
  public Subset intersectSubsets(Subset subset1, Subset subset2)
    throws Exception{ 
    BitSet b1 =(BitSet)subset1.subset.clone ();
    BitSet b2 =(BitSet)subset2.subset.clone ();
 
    b1.and (b2);
 
    double newMerit =ASEvaluator.evaluateSubset (b1);
    m_totalEvals++;
 
    return new Subset((BitSet)b1.clone (), newMerit);
  } 
 
  public Subset simetricDif(Subset subset1, Subset subset2, int mode)
    throws Exception{ 
    BitSet b1 =(BitSet)subset1.subset.clone ();
    BitSet b2 =(BitSet)subset2.subset.clone ();
 
    b1.xor (b2);