Exemplo n.º 1
0
 public boolean containsAll(BooleanIterable source) {
   for (BooleanIterator iterator = source.booleanIterator(); iterator.hasNext(); ) {
     if (!this.contains(iterator.next())) {
       return false;
     }
   }
   return true;
 }
 public boolean removeAll(BooleanIterable source) {
   if (this.isEmpty() || source.isEmpty()) {
     return false;
   }
   boolean modified = false;
   BooleanIterator iterator = source.booleanIterator();
   while (iterator.hasNext()) {
     if (this.state == 0) {
       return modified;
     }
     boolean item = iterator.next();
     if (this.remove(item)) {
       modified = true;
     }
   }
   return modified;
 }
Exemplo n.º 3
0
 private BooleanArrayList(BooleanIterable booleanIterable) {
   BooleanIterator booleanIterator = booleanIterable.booleanIterator();
   while (booleanIterator.hasNext()) {
     this.add(booleanIterator.next());
   }
 }