/** {@inheritDoc} */ public boolean removeAll( TCharCollection collection ) { if ( this == collection ) { clear(); return true; } boolean changed = false; TCharIterator iter = collection.iterator(); while ( iter.hasNext() ) { char element = iter.next(); if ( remove( element ) ) { changed = true; } } return changed; }
/** {@inheritDoc} */ public boolean removeAll( TCharCollection collection ) { if ( collection == this ) { clear(); return true; } boolean changed = false; TCharIterator iter = collection.iterator(); while ( iter.hasNext() ) { char element = iter.next(); if ( remove( element ) ) { changed = true; } } return changed; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TCharLinkedList that = (TCharLinkedList) o; if (no_entry_value != that.no_entry_value) return false; if (size != that.size) return false; TCharIterator iterator = iterator(); TCharIterator thatIterator = that.iterator(); while (iterator.hasNext()) { if (!thatIterator.hasNext()) return false; if (iterator.next() != thatIterator.next()) return false; } return true; }
/** * Creates an iterator over the values of the set. * * @return an iterator with support for removals in the underlying set */ public Iterator<Character> iterator() { return new Iterator<Character>() { private final TCharIterator it = _set.iterator(); public Character next() { return Character.valueOf( it.next() ); } public boolean hasNext() { return it.hasNext(); } public void remove() { it.remove(); } }; }
/** {@inheritDoc} */ public boolean containsAll( TCharCollection collection ) { if ( collection == this ) { return true; } TCharIterator iter = collection.iterator(); while ( iter.hasNext() ) { if ( ! TCharObjectHashMap.this.containsKey( iter.next() ) ) { return false; } } return true; }
/** {@inheritDoc} */ public boolean retainAll( Collection<?> collection ) { boolean modified = false; TCharIterator iter = iterator(); while ( iter.hasNext() ) { //noinspection SuspiciousMethodCalls if ( ! collection.contains( Character.valueOf ( iter.next() ) ) ) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean containsAll( TCharCollection collection ) { if ( this == collection ) { return true; } TCharIterator iter = collection.iterator(); while ( iter.hasNext() ) { char element = iter.next(); if ( ! contains( element ) ) { return false; } } return true; }
@Override public String toString() { final StringBuilder buf = new StringBuilder("{"); TCharIterator it = iterator(); while (it.hasNext()) { char next = it.next(); buf.append(next); if (it.hasNext()) buf.append(", "); } buf.append("}"); return buf.toString(); }
/** {@inheritDoc} */ public boolean removeAll(Collection<?> collection) { boolean modified = false; TCharIterator iter = iterator(); while (iter.hasNext()) { if (collection.contains(Character.valueOf(iter.next()))) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ @SuppressWarnings({"SuspiciousMethodCalls"}) public boolean retainAll( Collection<?> collection ) { boolean modified = false; TCharIterator iter = iterator(); while ( iter.hasNext() ) { if ( ! collection.contains( Character.valueOf ( iter.next() ) ) ) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean retainAll( TCharCollection collection ) { if ( this == collection ) { return false; } boolean modified = false; TCharIterator iter = iterator(); while ( iter.hasNext() ) { if ( ! collection.contains( iter.next() ) ) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean removeAll(TCharCollection collection) { boolean modified = false; TCharIterator iter = iterator(); while (iter.hasNext()) { if (collection.contains(iter.next())) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean containsAll( TCharCollection collection ) { TCharIterator iter = collection.iterator(); while ( iter.hasNext() ) { if ( ! TObjectCharCustomHashMap.this.containsValue( iter.next() ) ) { return false; } } return true; }
/** {@inheritDoc} */ public boolean containsAll( TCharCollection collection ) { TCharIterator iter = collection.iterator(); while ( iter.hasNext() ) { char element = iter.next(); if ( ! contains( element ) ) { return false; } } return true; }
/** {@inheritDoc} */ public boolean addAll( TCharCollection collection ) { boolean changed = false; TCharIterator iter = collection.iterator(); while ( iter.hasNext() ) { char element = iter.next(); if ( add( element ) ) { changed = true; } } return changed; }
/** {@inheritDoc} */ public boolean removeAll( TCharCollection collection ) { boolean changed = false; TCharIterator iter = collection.iterator(); while ( iter.hasNext() ) { char element = iter.next(); if ( remove( element ) ) { changed = true; } } return changed; }
public TCharLinkedList(TCharList list) { no_entry_value = list.getNoEntryValue(); // for (TCharIterator iterator = list.iterator(); iterator.hasNext();) { char next = iterator.next(); add(next); } }
/** {@inheritDoc} */ public boolean retainAll(TCharCollection collection) { boolean modified = false; TCharIterator iter = iterator(); while (iter.hasNext()) { if (!collection.contains(iter.next())) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean retainAll(char[] array) { Arrays.sort(array); boolean modified = false; TCharIterator iter = iterator(); while (iter.hasNext()) { if (Arrays.binarySearch(array, iter.next()) < 0) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public boolean retainAll(Collection<?> collection) { boolean modified = false; TCharIterator iter = iterator(); while (iter.hasNext()) { if (!collection.contains(Character.valueOf(iter.next()))) { iter.remove(); modified = true; } } return modified; }
/** {@inheritDoc} */ public TCharIterator iterator() { return new TCharIterator() { TCharLink l = head; TCharLink current; public char next() { if (no(l)) throw new NoSuchElementException(); char ret = l.getValue(); current = l; l = l.getNext(); return ret; } public boolean hasNext() { return got(l); } public void remove() { if (current == null) throw new IllegalStateException(); removeLink(current); current = null; } }; }
/** {@inheritDoc} */ public boolean addAll(TCharCollection collection) { boolean ret = false; for (TCharIterator it = collection.iterator(); it.hasNext();) { char i = it.next(); if (add(i)) ret = true; } return ret; }