public final class IdentitySet extends Object implements Set
Set
interface.Modifier and Type | Class and Description |
---|---|
class |
IdentitySet.Entry
An entry of the
IdentitySet . |
Constructor and Description |
---|
IdentitySet()
Construct a set with default capacity.
|
IdentitySet(int capacity)
Construct a set with given capacity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object key) |
boolean |
addAll(Collection c)
This optional method has not been implemented for
IdentitySet instead
it throws a UnsupportedOperationException as defined in the
Set interface. |
void |
clear() |
boolean |
contains(Object key) |
boolean |
containsAll(Collection c)
In contrast with the design contract of the
Set interface this method
has not been implemented and throws a UnsupportedOperationException . |
boolean |
isEmpty() |
Iterator |
iterator() |
boolean |
remove(Object key) |
boolean |
removeAll(Collection c)
This optional method has not been implemented for
IdentitySet instead
it throws a UnsupportedOperationException as defined in the
Set interface. |
boolean |
retainAll(Collection c)
This optional method has not been implemented for
IdentitySet instead
it throws a UnsupportedOperationException as defined in the
Set interface. |
int |
size() |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, spliterator
parallelStream, removeIf, stream
public IdentitySet()
public IdentitySet(int capacity)
capacity
- The capacity of entries this set should be initialized with.public void clear()
clear
in interface Collection
clear
in interface Set
Collection.clear()
public int size()
size
in interface Collection
size
in interface Set
Collection.size()
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface Set
Collection.isEmpty()
public boolean add(Object key)
add
in interface Collection
add
in interface Set
Collection.add(java.lang.Object)
public boolean contains(Object key)
contains
in interface Collection
contains
in interface Set
Collection.contains(java.lang.Object)
public boolean remove(Object key)
remove
in interface Collection
remove
in interface Set
Collection.remove(java.lang.Object)
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in interface Set
Collection.iterator()
public Object[] toArray()
toArray
in interface Collection
toArray
in interface Set
Collection.toArray()
public Object[] toArray(Object[] a)
toArray
in interface Collection
toArray
in interface Set
Collection.toArray(java.lang.Object[])
public boolean containsAll(Collection c)
Set
interface this method
has not been implemented and throws a UnsupportedOperationException
.
containsAll
in interface Collection
containsAll
in interface Set
Set.containsAll(java.util.Collection<?>)
public boolean addAll(Collection c)
IdentitySet
instead
it throws a UnsupportedOperationException
as defined in the
Set
interface.
addAll
in interface Collection
addAll
in interface Set
Set.addAll(java.util.Collection<? extends E>)
public boolean removeAll(Collection c)
IdentitySet
instead
it throws a UnsupportedOperationException
as defined in the
Set
interface.
removeAll
in interface Collection
removeAll
in interface Set
Set.removeAll(java.util.Collection<?>)
public boolean retainAll(Collection c)
IdentitySet
instead
it throws a UnsupportedOperationException
as defined in the
Set
interface.
retainAll
in interface Collection
retainAll
in interface Set
Set.retainAll(java.util.Collection<?>)
Copyright © 2018. All rights reserved.