public void forEach(Consumer<? super E> action) { if (action == null) throw new java.lang.NullPointerException(); if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { action.accept(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public boolean forEachWhile( Predicate<? super E> predicate) { if (predicate == null) throw new java.lang.NullPointerException(); if (this.isEmpty()) return true; boolean terminated = false; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { if (!predicate.test(key)) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
public String setToString() { if (this.isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { sb.append(' ').append(key != (Object) this ? key : "(this Collection)").append(','); if (++elementCount == 8) { int expectedLength = sb.length() * (size() / 8); sb.ensureCapacity(expectedLength + (expectedLength / 2)); } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); sb.setCharAt(0, '['); sb.setCharAt(sb.length() - 1, ']'); return sb.toString(); }
public void forEach(Consumer<? super E> action) { if (action == null) throw new java.lang.NullPointerException(); if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { action.accept(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public String setToString() { if (this.isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { sb.append(' ').append(key != (Object) this ? key : "(this Collection)").append(','); if (++elementCount == 8) { int expectedLength = sb.length() * (size() / 8); sb.ensureCapacity(expectedLength + (expectedLength / 2)); } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); sb.setCharAt(0, '['); sb.setCharAt(sb.length() - 1, ']'); return sb.toString(); }
public boolean reverseAddAllTo(ObjCollection<? super E> c) { if (this.isEmpty()) return false; boolean changed = false; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { changed |= c.add(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean reverseAddAllTo(ObjCollection<? super E> c) { if (this.isEmpty()) return false; boolean changed = false; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { changed |= c.add(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean forEachWhile( Predicate<? super E> predicate) { if (predicate == null) throw new java.lang.NullPointerException(); if (this.isEmpty()) return true; boolean terminated = false; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { if (!predicate.test(key)) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
public boolean allContainingIn(ObjCollection<?> c) { if (this.isEmpty()) return true; boolean containsAll = true; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { if (!c.contains(key)) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
public boolean allContainingIn(ObjCollection<?> c) { if (this.isEmpty()) return true; boolean containsAll = true; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { if (!c.contains(key)) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
public boolean reverseRemoveAllFrom(ObjSet<?> s) { if (this.isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { changed |= s.remove(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean reverseRemoveAllFrom(ObjSet<?> s) { if (this.isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); Object[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { E key; // noinspection unchecked if ((key = (E) keys[i]) != FREE) { changed |= s.remove(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
boolean removeAll(@Nonnull HashObjSet<E> thisC, @Nonnull Collection<?> c) { if (thisC == (Object) c) throw new IllegalArgumentException(); if (this.isEmpty() || c.isEmpty()) return false; boolean changed = false;
boolean removeAll(@Nonnull HashObjSet<E> thisC, @Nonnull Collection<?> c) { if (thisC == (Object) c) throw new IllegalArgumentException(); if (this.isEmpty() || c.isEmpty()) return false; boolean changed = false;
boolean retainAll(@Nonnull HashObjSet<E> thisC, @Nonnull Collection<?> c) { if (thisC == (Object) c) throw new IllegalArgumentException(); if (this.isEmpty()) return false; if (c.isEmpty()) {
boolean retainAll(@Nonnull HashObjSet<E> thisC, @Nonnull Collection<?> c) { if (thisC == (Object) c) throw new IllegalArgumentException(); if (this.isEmpty()) return false; if (c.isEmpty()) {
public boolean removeIf(Predicate<? super E> filter) { if (filter == null) throw new java.lang.NullPointerException(); if (this.isEmpty()) return false; boolean changed = false;
public boolean removeIf(Predicate<? super E> filter) { if (filter == null) throw new java.lang.NullPointerException(); if (this.isEmpty()) return false; boolean changed = false;