/** {@inheritDoc} */ public boolean removeAll( TByteCollection collection ) { if ( this == collection ) { clear(); return true; } boolean changed = false; TByteIterator iter = collection.iterator(); while ( iter.hasNext() ) { byte element = iter.next(); if ( remove( element ) ) { changed = true; } } return changed; }
/** {@inheritDoc} */ public boolean removeAll( TByteCollection collection ) { if ( collection == this ) { clear(); return true; } boolean changed = false; TByteIterator iter = collection.iterator(); while ( iter.hasNext() ) { byte element = iter.next(); if ( remove( element ) ) { changed = true; } } return changed; }
/** * Creates an iterator over the values of the set. * * @return an iterator with support for removals in the underlying set */ public Iterator<Byte> iterator() { return new Iterator<Byte>() { private final TByteIterator it = _set.iterator(); public Byte next() { return Byte.valueOf( it.next() ); } public boolean hasNext() { return it.hasNext(); } public void remove() { it.remove(); } }; }
/** {@inheritDoc} */ public boolean containsAll( TByteCollection collection ) { TByteIterator iter = collection.iterator(); while ( iter.hasNext() ) { if ( ! TObjectByteHashMap.this.containsValue( iter.next() ) ) { return false; } } return true; }
/** {@inheritDoc} */ @SuppressWarnings({"SuspiciousMethodCalls"}) public boolean retainAll( Collection<?> collection ) { boolean modified = false; TByteIterator iter = iterator(); while ( iter.hasNext() ) { if ( ! collection.contains( Byte.valueOf ( iter.next() ) ) ) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean retainAll( TByteCollection collection ) { if ( this == collection ) { return false; } boolean modified = false; TByteIterator iter = iterator(); while ( iter.hasNext() ) { if ( ! collection.contains( iter.next() ) ) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean addAll(TByteCollection collection) { boolean ret = false; for (TByteIterator it = collection.iterator(); it.hasNext();) { byte i = it.next(); if (add(i)) ret = true; } return ret; }
/** {@inheritDoc} */ public boolean retainAll( Collection<?> collection ) { boolean modified = false; TByteIterator iter = iterator(); while ( iter.hasNext() ) { //noinspection SuspiciousMethodCalls if ( ! collection.contains( Byte.valueOf ( iter.next() ) ) ) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean containsAll( TByteCollection collection ) { if ( this == collection ) { return true; } TByteIterator iter = collection.iterator(); while ( iter.hasNext() ) { byte element = iter.next(); if ( ! contains( element ) ) { return false; } } return true; }
/** {@inheritDoc} */ public boolean containsAll( TByteCollection collection ) { TByteIterator iter = collection.iterator(); while ( iter.hasNext() ) { if ( ! TObjectByteCustomHashMap.this.containsValue( iter.next() ) ) { return false; } } return true; }
/** {@inheritDoc} */ public boolean containsAll( TByteCollection collection ) { TByteIterator iter = collection.iterator(); while ( iter.hasNext() ) { byte element = iter.next(); if ( ! contains( element ) ) { return false; } } return true; }
/** {@inheritDoc} */ public boolean addAll( TByteCollection collection ) { boolean changed = false; TByteIterator iter = collection.iterator(); while ( iter.hasNext() ) { byte element = iter.next(); if ( add( element ) ) { changed = true; } } return changed; }
/** {@inheritDoc} */ public void writeExternal(ObjectOutput out) throws IOException { // VERSION out.writeByte(0); // NO_ENTRY_VALUE out.writeByte(no_entry_value); // ENTRIES out.writeInt(size); for (TByteIterator iterator = iterator(); iterator.hasNext();) { byte next = iterator.next(); out.writeByte(next); } }
public TByteLinkedList(TByteList list) { no_entry_value = list.getNoEntryValue(); // for (TByteIterator iterator = list.iterator(); iterator.hasNext();) { byte next = iterator.next(); add(next); } }
/** {@inheritDoc} */ public boolean containsAll(TByteCollection collection) { if (isEmpty()) return false; for (TByteIterator it = collection.iterator(); it.hasNext();) { byte i = it.next(); if (!(contains(i))) return false; } return true; }
/** {@inheritDoc} */ public boolean retainAll(Collection<?> collection) { boolean modified = false; TByteIterator iter = iterator(); while (iter.hasNext()) { if (!collection.contains(Byte.valueOf(iter.next()))) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean retainAll(TByteCollection collection) { boolean modified = false; TByteIterator iter = iterator(); while (iter.hasNext()) { if (!collection.contains(iter.next())) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean retainAll(byte[] array) { Arrays.sort(array); boolean modified = false; TByteIterator iter = iterator(); while (iter.hasNext()) { if (Arrays.binarySearch(array, iter.next()) < 0) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean removeAll(TByteCollection collection) { boolean modified = false; TByteIterator iter = iterator(); while (iter.hasNext()) { if (collection.contains(iter.next())) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean removeAll(byte[] array) { Arrays.sort(array); boolean modified = false; TByteIterator iter = iterator(); while (iter.hasNext()) { if (Arrays.binarySearch(array, iter.next()) >= 0) { iter.remove(); modified = true; } } return modified; }