org.zkoss.util
Class IdentityHashSet<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<T>
org.zkoss.util.IdentityHashSet<T>
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<T>, Collection<T>, Set<T>
public class IdentityHashSet<T>
- extends AbstractSet<T>
- implements Set<T>, Cloneable, Serializable
Like java.util.InternalHashMap, it uses == and System.identityHashCode
for doing HashSet.
- Author:
- tomyeh
- See Also:
IdentityComparator,
Serialized Form
|
Constructor Summary |
IdentityHashSet()
Constructs a new, empty set; the backing IdentityHashMap
instance has default capacity (32). |
IdentityHashSet(Collection<T> c)
Constructs a new set containing the elements in the specified
collection. |
IdentityHashSet(int expectedMaxSize)
Constructs a new, empty set with the specified expected maximum size. |
IdentityHashSet
public IdentityHashSet()
- Constructs a new, empty set; the backing IdentityHashMap
instance has default capacity (32).
IdentityHashSet
public IdentityHashSet(Collection<T> c)
- Constructs a new set containing the elements in the specified
collection.
- Parameters:
c - the collection whose elements are to be placed into this set.
- Throws:
NullPointerException - if the specified collection is null.
IdentityHashSet
public IdentityHashSet(int expectedMaxSize)
- Constructs a new, empty set with the specified expected maximum size.
- Parameters:
expectedMaxSize - the expected maximum size of the map.
- Throws:
IllegalArgumentException - if expectedMaxSize is negative
iterator
public Iterator<T> iterator()
- Specified by:
iterator in interface Iterable<T>- Specified by:
iterator in interface Collection<T>- Specified by:
iterator in interface Set<T>- Specified by:
iterator in class AbstractCollection<T>
size
public int size()
- Specified by:
size in interface Collection<T>- Specified by:
size in interface Set<T>- Specified by:
size in class AbstractCollection<T>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Collection<T>- Specified by:
isEmpty in interface Set<T>- Overrides:
isEmpty in class AbstractCollection<T>
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection<T>- Specified by:
contains in interface Set<T>- Overrides:
contains in class AbstractCollection<T>
add
public boolean add(T o)
- Specified by:
add in interface Collection<T>- Specified by:
add in interface Set<T>- Overrides:
add in class AbstractCollection<T>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<T>- Specified by:
remove in interface Set<T>- Overrides:
remove in class AbstractCollection<T>
clear
public void clear()
- Specified by:
clear in interface Collection<T>- Specified by:
clear in interface Set<T>- Overrides:
clear in class AbstractCollection<T>
clone
public Object clone()
- Overrides:
clone in class Object
Copyright © 2011. All Rights Reserved.