public void forEach(BooleanProcedure procedure) {
   switch (this.state) {
     case 0:
       return;
     case 1:
       procedure.value(false);
       return;
     case 2:
       procedure.value(true);
       return;
     case 3:
       procedure.value(false);
       procedure.value(true);
       return;
     default:
       throw new AssertionError("Invalid state");
   }
 }
Exemplo n.º 2
0
 public void forEach(BooleanProcedure procedure) {
   BooleanIterator iterator = this.booleanIterator();
   while (iterator.hasNext()) {
     procedure.value(iterator.next());
   }
 }
Exemplo n.º 3
0
 public void forEach(BooleanProcedure procedure) {
   for (int i = 0; i < this.size; i++) {
     procedure.value(this.items.get(i));
   }
 }