use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.
the class ObjectBooleanHashMapValuesTestCase method booleanIterator.
@Override
@Test
public void booleanIterator() {
MutableBooleanCollection bag = this.newWith(true, false, true, true);
BooleanArrayList list = BooleanArrayList.newListWith(true, false, true, true);
BooleanIterator iterator1 = bag.booleanIterator();
for (int i = 0; i < 4; i++) {
Assert.assertTrue(iterator1.hasNext());
Assert.assertTrue(list.remove(iterator1.next()));
}
Verify.assertEmpty(list);
Assert.assertFalse(iterator1.hasNext());
Verify.assertThrows(NoSuchElementException.class, (Runnable) iterator1::next);
ObjectBooleanHashMap<String> map2 = new ObjectBooleanHashMap<>();
for (int each = 2; each < 100; each++) {
map2.put(String.valueOf(each), each % 2 == 0);
}
MutableBooleanIterator iterator2 = map2.booleanIterator();
while (iterator2.hasNext()) {
iterator2.next();
iterator2.remove();
}
Assert.assertTrue(map2.isEmpty());
}
use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project narchy by automenta.
the class EngineRunner method initialize.
/**
* Config this Manager
*/
EngineRunner initialize(Prolog vm) {
mediator = vm;
theories = vm.theories;
primitives = vm.prims;
libraryManager = vm.libs;
engineManager = vm.engine;
detached = false;
solving = false;
sinfo = null;
msgs = new TermQueue();
next = new BooleanArrayList();
countNext = 0;
lockVar = new ReentrantLock();
cond = lockVar.newCondition();
return this;
}
use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.
the class OrderedMapAdapter method collectBoolean.
@Override
public MutableBooleanList collectBoolean(BooleanFunction<? super V> booleanFunction) {
BooleanArrayList result = new BooleanArrayList(this.size());
this.forEach(new CollectBooleanProcedure<>(booleanFunction, result));
return result;
}
use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.
the class AbstractImmutableSortedMap method collectBoolean.
@Override
public ImmutableBooleanList collectBoolean(BooleanFunction<? super V> booleanFunction) {
BooleanArrayList result = new BooleanArrayList(this.size());
this.forEach(new CollectBooleanProcedure<>(booleanFunction, result));
return result.toImmutable();
}
use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.
the class AbstractImmutableSortedSet method collectBoolean.
@Override
public ImmutableBooleanList collectBoolean(BooleanFunction<? super T> booleanFunction) {
BooleanArrayList result = new BooleanArrayList(this.size());
this.forEach(new CollectBooleanProcedure<>(booleanFunction, result));
return result.toImmutable();
}
Aggregations