Search in sources :

Example 1 with BooleanIterator

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;
}
Also used : ImmutableBooleanSet(org.eclipse.collections.api.set.primitive.ImmutableBooleanSet) BooleanIterator(org.eclipse.collections.api.iterator.BooleanIterator) ImmutableEmptyBooleanIterator(org.eclipse.collections.impl.iterator.ImmutableEmptyBooleanIterator)

Example 2 with BooleanIterator

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;
}
Also used : ImmutableBooleanSet(org.eclipse.collections.api.set.primitive.ImmutableBooleanSet) BooleanIterator(org.eclipse.collections.api.iterator.BooleanIterator)

Example 3 with BooleanIterator

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;
}
Also used : ImmutableBooleanSet(org.eclipse.collections.api.set.primitive.ImmutableBooleanSet) BooleanIterator(org.eclipse.collections.api.iterator.BooleanIterator)

Example 4 with BooleanIterator

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());
}
Also used : BooleanIterator(org.eclipse.collections.api.iterator.BooleanIterator) Test(org.junit.Test)

Example 5 with BooleanIterator

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());
}
Also used : BooleanIterator(org.eclipse.collections.api.iterator.BooleanIterator) Test(org.junit.Test)

Aggregations

BooleanIterator (org.eclipse.collections.api.iterator.BooleanIterator)39 Test (org.junit.Test)22 BooleanIterable (org.eclipse.collections.api.BooleanIterable)10 MutableBooleanIterator (org.eclipse.collections.api.iterator.MutableBooleanIterator)10 LazyBooleanIterable (org.eclipse.collections.api.LazyBooleanIterable)7 MutableBooleanBag (org.eclipse.collections.api.bag.primitive.MutableBooleanBag)6 ImmutableBooleanSet (org.eclipse.collections.api.set.primitive.ImmutableBooleanSet)5 BooleanBag (org.eclipse.collections.api.bag.primitive.BooleanBag)2 ImmutableBooleanBag (org.eclipse.collections.api.bag.primitive.ImmutableBooleanBag)2 MutableBooleanList (org.eclipse.collections.api.list.primitive.MutableBooleanList)2 ReverseBooleanIterable (org.eclipse.collections.impl.lazy.primitive.ReverseBooleanIterable)2 BooleanArrayList (org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList)2 BitSet (java.util.BitSet)1 MutableBooleanCollection (org.eclipse.collections.api.collection.primitive.MutableBooleanCollection)1 BooleanHashBag (org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag)1 ImmutableEmptyBooleanIterator (org.eclipse.collections.impl.iterator.ImmutableEmptyBooleanIterator)1 UnmodifiableBooleanIterator (org.eclipse.collections.impl.iterator.UnmodifiableBooleanIterator)1 AbstractBooleanIterable (org.eclipse.collections.impl.primitive.AbstractBooleanIterable)1 SynchronizedBooleanIterable (org.eclipse.collections.impl.primitive.SynchronizedBooleanIterable)1