/** * Returns {@code true} if the iteration has more elements. * (In other words, returns {@code true} if {@link #next} would * return an element rather than throwing an exception.) * * @return {@code true} if the iteration has more elements */ @Override public boolean hasNext() { return iterator.hasNext(); }
@Override public boolean hasNext() { return i.hasNext(); } @Override
@Override public boolean hasNext() { return iterator.hasNext(); } @Deprecated
@Override public boolean hasNext() { return iterator.hasNext(); } @Deprecated
@Override public boolean hasNext() { return iterator.hasNext(); } @Deprecated
private void advance() { while (length != 0) { if (a[offset].hasNext()) break; length--; offset++; } return; } @Override
@Override public boolean hasNext() { return iterator.hasNext(); } @Deprecated
@Override public boolean hasNext() { return iterator.hasNext(); } @Deprecated
/** 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 storeBytes(final ByteIterator i, final DataOutput dataOutput) throws IOException { while(i.hasNext()) dataOutput.writeByte(i.nextByte()); } /** 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 print stream. * * @param i an iterator whose output will be written to {@code stream}. * @param stream a print stream. */ public static void storeBytes(final ByteIterator i, final PrintStream stream) { while(i.hasNext()) stream.println(i.nextByte()); } /** Stores the element returned by an iterator to a file given by a {@link File} object.
@Override public boolean isEmpty() { return !iterable.iterator().hasNext(); } @Override
/** 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 storeBytes(final ByteIterator i, final File file) throws IOException { final DataOutputStream dos = new DataOutputStream(new FastBufferedOutputStream(new FileOutputStream(file))); while(i.hasNext()) dos.writeByte(i.nextByte()); dos.close(); } /** Stores the element returned by an iterator to a file given by a pathname.
/** * Creates a new tree set using elements provided by a type-specific iterator. * * @param i * a type-specific iterator whose elements will fill the set. */ public ByteRBTreeSet(final ByteIterator i) { while (i.hasNext()) add(i.nextByte()); } /**
@Override public int size() { int c = 0; final ByteIterator iterator = iterator(); while (iterator.hasNext()) { iterator.nextByte(); c++; } return c; } @Override
/** * Creates a new tree set using elements provided by a type-specific iterator. * * @param i * a type-specific iterator whose elements will fill the set. */ public ByteAVLTreeSet(final ByteIterator i) { while (i.hasNext()) add(i.nextByte()); } /**
@Override public boolean addAll(final ByteCollection c) { boolean retVal = false; for (final ByteIterator i = c.iterator(); i.hasNext();) if (add(i.nextByte())) retVal = true; return retVal; } @Override
@Override public boolean removeAll(final ByteCollection c) { boolean retVal = false; for (final ByteIterator i = c.iterator(); i.hasNext();) if (rem(i.nextByte())) retVal = true; return retVal; } @Override
@Override public boolean containsAll(final ByteCollection c) { for (final ByteIterator i = c.iterator(); i.hasNext();) if (!contains(i.nextByte())) return false; return true; } @Override
@Override public boolean retainAll(final ByteCollection c) { boolean retVal = false; for (final ByteIterator i = iterator(); i.hasNext();) if (!c.contains(i.nextByte())) { i.remove(); retVal = true; } return retVal; } @Override