@Override public BooleanColumn fillWith(BooleanIterator iterator) { for (int r = 0; r < size(); r++) { if (!iterator.hasNext()) { break; } set(r, iterator.nextBoolean()); } return this; }
@Override public boolean hasNext() { return i.hasNext(); } @Override
private void advance() { while (length != 0) { if (a[offset].hasNext()) break; length--; offset++; } return; } @Override
@Override public boolean isEmpty() { return !iterable.iterator().hasNext(); } @Override
/** Stores the element returned by an iterator to a given print stream. * * @param i an iterator whose output will be written to {@code stream}. * @param stream a print stream. */ public static void storeBooleans(final BooleanIterator i, final PrintStream stream) { while(i.hasNext()) stream.println(i.nextBoolean()); } /** Stores the element returned by an iterator to a file given by a {@link File} object.
/** Stores the element returned by an iterator to a given data output. * * @param i an iterator whose output will be written to {@code dataOutput}. * @param dataOutput a filename. */ public static void storeBooleans(final BooleanIterator i, final DataOutput dataOutput) throws IOException { while(i.hasNext()) dataOutput.writeBoolean(i.nextBoolean()); } /** Stores the element returned by an iterator to a file given by a {@link File} object.
public static boolean all(final BooleanIterator iterator, final java.util.function.Predicate<? super Boolean> predicate) { Objects.requireNonNull(predicate); do { if (!iterator.hasNext()) return true; } while (predicate.test(Boolean.valueOf(iterator.nextBoolean()))); return false; } public static int indexOf(final BooleanIterator iterator,
public static int indexOf(final BooleanIterator iterator, final java.util.function.Predicate<? super Boolean> predicate) { Objects.requireNonNull(predicate); for (int i = 0; iterator.hasNext(); ++i) { if (predicate.test(Boolean.valueOf(iterator.nextBoolean()))) return i; } return -1; } private static class IteratorConcatenator implements BooleanIterator {
/** Stores the element returned by an iterator to a file given by a {@link File} object. * * @param i an iterator whose output will be written to {@code filename}. * @param file a file. */ public static void storeBooleans(final BooleanIterator i, final File file) throws IOException { final DataOutputStream dos = new DataOutputStream(new FastBufferedOutputStream(new FileOutputStream(file))); while(i.hasNext()) dos.writeBoolean(i.nextBoolean()); dos.close(); } /** Stores the element returned by an iterator to a file given by a pathname.
@Override public int size() { int c = 0; final BooleanIterator iterator = iterator(); while (iterator.hasNext()) { iterator.nextBoolean(); c++; } return c; } @Override
/** * Creates a new hash set using elements provided by a type-specific iterator. * * @param i * a type-specific iterator whose elements will fill the set. * @param f * the load factor. */ public BooleanOpenHashSet(final BooleanIterator i, final float f) { this(DEFAULT_INITIAL_SIZE, f); while (i.hasNext()) add(i.nextBoolean()); } /**
/** * Creates a new array list and fills it with the elements returned by a * type-specific iterator.. * * @param i * a type-specific iterator whose returned elements will fill the * array list. */ public BooleanArrayList(final BooleanIterator i) { this(); while (i.hasNext()) this.add(i.nextBoolean()); } /**
/** * Creates a new big-array big list and fills it with the elements returned by a * type-specific iterator.. * * @param i * a type-specific iterator whose returned elements will fill the * array list. */ public BooleanBigArrayBigList(final BooleanIterator i) { this(); while (i.hasNext()) this.add(i.nextBoolean()); } /**
@Override public boolean addAll(final BooleanCollection c) { boolean retVal = false; for (final BooleanIterator i = c.iterator(); i.hasNext();) if (add(i.nextBoolean())) retVal = true; return retVal; } @Override
@Override public boolean removeAll(final BooleanCollection c) { boolean retVal = false; for (final BooleanIterator i = c.iterator(); i.hasNext();) if (rem(i.nextBoolean())) retVal = true; return retVal; } @Override
@Override public boolean containsAll(final BooleanCollection c) { for (final BooleanIterator i = c.iterator(); i.hasNext();) if (!contains(i.nextBoolean())) return false; return true; } @Override
@Override public boolean retainAll(final BooleanCollection c) { boolean retVal = false; for (final BooleanIterator i = iterator(); i.hasNext();) if (!c.contains(i.nextBoolean())) { i.remove(); retVal = true; } return retVal; } @Override
/** * Creates a new big-array big list and fills it with a given type-specific * collection. * * @param c * a type-specific collection that will be used to fill the array * list. */ public BooleanBigArrayBigList(final BooleanCollection c) { this(c.size()); for (BooleanIterator i = c.iterator(); i.hasNext();) add(i.nextBoolean()); } /**