@Test public void testRetainAllWithPredicate() { set.addAll(newArray(k0, k1, k2, k3, k4, k5)); assertEquals(4, set.retainAll(new KTypePredicate<KType>() { public boolean apply(KType v) { return v == key1 || v == key2; } })); assertSortedListEquals(set.toArray(), key1, key2); }
@SafeVarargs public final int addAll(KType... elements) { ensureCapacity(elements.length); int count = 0; for (KType e : elements) { if (add(e)) { count++; } } return count; }
KTypeWormSet extends AbstractKTypeCollection<KType> implements /*! #if ($templateonly) !*/ Intrinsics.KeyHasher<KType>, /*! #end !*/
        KTypeLookupContainer<KType>,
        KTypeSet<KType>,
        Preallocable,
        Cloneable,
        Accountable { @SafeVarargs public final int addAll(KType... elements) { ensureCapacity(elements.length); int count = 0; for (KType e : elements) { if (add(e)) { count++; } } return count; } }
KTypeWormSet extends AbstractKTypeCollection<KType> implements /*! #if ($templateonly) !*/ Intrinsics.KeyHasher<KType>, /*! #end !*/
        KTypeLookupContainer<KType>,
        KTypeSet<KType>,
        Preallocable,
        Cloneable,
        Accountable { @SafeVarargs public final int addAll(KType... elements) { ensureCapacity(elements.length); int count = 0; for (KType e : elements) { if (add(e)) { count++; } } return count; } KTypeWormSet();  KTypeWormSet(int expectedElements);  KTypeWormSet(KTypeContainer<? extends KType> container); }
KTypeWormSet extends AbstractKTypeCollection<KType> implements /*! #if ($templateonly) !*/ Intrinsics.KeyHasher<KType>, /*! #end !*/
        KTypeLookupContainer<KType>,
        KTypeSet<KType>,
        Preallocable,
        Cloneable,
        Accountable { @SafeVarargs public final int addAll(KType... elements) { ensureCapacity(elements.length); int count = 0; for (KType e : elements) { if (add(e)) { count++; } } return count; } KTypeWormSet();  KTypeWormSet(int expectedElements);  KTypeWormSet(KTypeContainer<? extends KType> container); @SafeVarargs /* #end */ static KTypeWormSet<KType> from(KType... elements); @Override KTypeWormSet<KType> clone(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(KType key); @Override boolean add(KType key); @SafeVarargs /* #end */ final int addAll(KType... elements); int addAll(KTypeContainer<? extends KType> container); int addAll(Iterable<? extends KTypeCursor<? extends KType>> iterable); boolean remove(KType key); @Override int removeAll(KType key); int removeAll(KTypeContainer<? super KType> other); @Override int removeAll(KTypePredicate<? super KType> predicate); @Override T forEach(T procedure); @Override T forEach(T predicate); @Override Iterator<KTypeCursor<KType>> iterator(); @Override void clear(); @Override void release(); @Override @SuppressWarnings("unchecked") boolean equals(Object o); @Override int hashCode(); @Override int hashKey(KType key); int indexOf(KType key); boolean indexExists(int index); KType indexGet(int index); KType indexReplace(int index, KType equivalentKey); void indexInsert(int index, KType key); @Override String toString(); @Override void ensureCapacity(int expectedElements); @Override String visualizeKeyDistribution(int characters); @Override long ramBytesAllocated(); @Override long ramBytesUsed(); }
KTypeWormSet extends AbstractKTypeCollection<KType> implements /*! #if ($templateonly) !*/ Intrinsics.KeyHasher<KType>, /*! #end !*/
        KTypeLookupContainer<KType>,
        KTypeSet<KType>,
        Preallocable,
        Cloneable,
        Accountable { @SafeVarargs public final int addAll(KType... elements) { ensureCapacity(elements.length); int count = 0; for (KType e : elements) { if (add(e)) { count++; } } return count; } KTypeWormSet();  KTypeWormSet(int expectedElements);  KTypeWormSet(KTypeContainer<? extends KType> container); @SafeVarargs /* #end */ static KTypeWormSet<KType> from(KType... elements); @Override KTypeWormSet<KType> clone(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(KType key); @Override boolean add(KType key); @SafeVarargs /* #end */ final int addAll(KType... elements); int addAll(KTypeContainer<? extends KType> container); int addAll(Iterable<? extends KTypeCursor<? extends KType>> iterable); boolean remove(KType key); @Override int removeAll(KType key); int removeAll(KTypeContainer<? super KType> other); @Override int removeAll(KTypePredicate<? super KType> predicate); @Override T forEach(T procedure); @Override T forEach(T predicate); @Override Iterator<KTypeCursor<KType>> iterator(); @Override void clear(); @Override void release(); @Override @SuppressWarnings("unchecked") boolean equals(Object o); @Override int hashCode(); @Override int hashKey(KType key); int indexOf(KType key); boolean indexExists(int index); KType indexGet(int index); KType indexReplace(int index, KType equivalentKey); void indexInsert(int index, KType key); @Override String toString(); @Override void ensureCapacity(int expectedElements); @Override String visualizeKeyDistribution(int characters); @Override long ramBytesAllocated(); @Override long ramBytesUsed(); public Object[] keys; public byte[] next; }