Package com.sun.identity.common
Class CaseInsensitiveHashSet<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet<T>
-
- com.sun.identity.common.CaseInsensitiveHashSet<T>
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<T>,Collection<T>,Set<T>
public class CaseInsensitiveHashSet<T> extends HashSet<T>
An implementation of Case Insensitive Hash Set with case preservation. Strings are converted to case insensitive strings before being hashed, but original case is preserved. The iterator returns the case preserved Strings that can be casted to a String, no different from an iterator from the standard Hash Set.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CaseInsensitiveHashSet()CaseInsensitiveHashSet(int initialCapacity)CaseInsensitiveHashSet(int initialCapacity, float loadFactor)CaseInsensitiveHashSet(Collection c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T o)booleancontains(Object o)Iterator<T>iterator()booleanremove(Object o)booleanremoveAll(Collection c)Removes all elements specified in the parameter collection from the current set.Object[]toArray()Object[]toArray(Object[] a)-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Constructor Detail
-
CaseInsensitiveHashSet
public CaseInsensitiveHashSet()
-
CaseInsensitiveHashSet
public CaseInsensitiveHashSet(Collection c)
-
CaseInsensitiveHashSet
public CaseInsensitiveHashSet(int initialCapacity)
-
CaseInsensitiveHashSet
public CaseInsensitiveHashSet(int initialCapacity, float loadFactor)
-
-
Method Detail
-
add
public boolean add(T o)
-
contains
public boolean contains(Object o)
-
remove
public boolean remove(Object o)
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<T>- Specified by:
toArrayin interfaceSet<T>- Overrides:
toArrayin classAbstractCollection<T>
-
removeAll
public boolean removeAll(Collection c)
Removes all elements specified in the parameter collection from the current set.- Specified by:
removeAllin interfaceCollection<T>- Specified by:
removeAllin interfaceSet<T>- Overrides:
removeAllin classAbstractSet<T>- Parameters:
c- The collection of elements that need to be removed from this set.- Returns:
trueif at least one element has been removed from this set.- See Also:
AbstractSet.removeAll(java.util.Collection)
-
-