public static class IntSets.EmptySet extends IntCollections.EmptyCollection implements IntSet, Serializable, Cloneable
This class may be useful to implement your own in case you subclass a type-specific set.
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
boolean |
equals(Object o) |
boolean |
rem(int k)
Deprecated.
|
boolean |
remove(int ok)
Removes an element from this set.
|
addAll, addAll, clear, contains, hashCode, iterator, removeAll, removeAll, retainAll, retainAll, size, toArrayadd, add, contains, containsAll, intIterator, remove, toArray, toIntArray, toIntArray, toStringcontainsAll, isEmpty, toArrayadd, addAll, contains, containsAll, intIterator, removeAll, retainAll, toArray, toIntArray, toIntArrayaddAll, clear, containsAll, hashCode, isEmpty, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streampublic boolean remove(int ok)
IntSet
Note that the corresponding method of a type-specific collection is
rem(). This unfortunate situation is caused by the clash with the
similarly named index-based method in the List
interface.
remove in interface IntSetCollection.remove(Object)public boolean equals(Object o)
equals in interface Collection<Integer>equals in interface Set<Integer>equals in class IntCollections.EmptyCollection@Deprecated public boolean rem(int k)
AbstractIntCollection
Note that this method should be called
remove(), but the clash with
the similarly named index-based method in the List
interface forces us to use a distinguished name. For simplicity, the set
interfaces reinstates remove().
This implementation iterates over the elements in the collection, looking for the specified element and tries to remove it.
rem in interface IntCollectionrem in interface IntSetrem in class AbstractIntCollectionCollection.remove(Object)