use of org.eclipse.collections.api.iterator.BooleanIterator in project eclipse-collections by eclipse.
the class ImmutableBooleanEmptySet method newWithAll.
@Override
public ImmutableBooleanSet newWithAll(BooleanIterable elements) {
ImmutableBooleanSet result = this;
BooleanIterator booleanIterator = elements.booleanIterator();
while (booleanIterator.hasNext()) {
result = result.newWith(booleanIterator.next());
}
return result;
}
use of org.eclipse.collections.api.iterator.BooleanIterator in project eclipse-collections by eclipse.
the class ImmutableTrueFalseSet method newWithAll.
@Override
public ImmutableBooleanSet newWithAll(BooleanIterable elements) {
ImmutableBooleanSet result = this;
BooleanIterator booleanIterator = elements.booleanIterator();
while (booleanIterator.hasNext()) {
result = result.newWith(booleanIterator.next());
}
return result;
}
use of org.eclipse.collections.api.iterator.BooleanIterator in project eclipse-collections by eclipse.
the class ImmutableTrueSet method newWithAll.
@Override
public ImmutableBooleanSet newWithAll(BooleanIterable elements) {
ImmutableBooleanSet result = this;
BooleanIterator booleanIterator = elements.booleanIterator();
while (booleanIterator.hasNext()) {
result = result.newWith(booleanIterator.next());
}
return result;
}
use of org.eclipse.collections.api.iterator.BooleanIterator in project eclipse-collections by eclipse.
the class SelectBooleanIterableTest method booleanIterator.
@Test
public void booleanIterator() {
StringBuilder concat = new StringBuilder();
for (BooleanIterator iterator = this.iterable.booleanIterator(); iterator.hasNext(); ) {
concat.append(iterator.next());
}
Assert.assertEquals("truetrue", concat.toString());
}
use of org.eclipse.collections.api.iterator.BooleanIterator in project eclipse-collections by eclipse.
the class TapBooleanIterableTest method booleanIterator.
@Test
public void booleanIterator() {
StringBuilder concat = new StringBuilder();
TapBooleanIterable iterable = new TapBooleanIterable(this.list, concat::append);
for (BooleanIterator iterator = iterable.booleanIterator(); iterator.hasNext(); ) {
iterator.next();
}
Assert.assertEquals("truefalsefalsetrue", concat.toString());
}
Aggregations