public class CaseInsensitiveSet extends SetDecorator<String>
iterator() method for example returns the originally values.
Note: The behavior of this class is undefined when wrapping a set that has keys that would result in duplicate case-insensitive values.
set| Constructor and Description |
|---|
CaseInsensitiveSet()
Constructs a new empty case-insensitive set.
|
CaseInsensitiveSet(Collection<String> c)
Constructs a new case-insensitive set containing the elements in the specified
collection.
|
CaseInsensitiveSet(int initialCapacity)
Constructs a new, empty case-insensitive set; the backing
HashSet instance has
the specified initial capacity and default load factor. |
CaseInsensitiveSet(int initialCapacity,
float loadFactor)
Constructs a new, empty case-insensitive set; the backing
HashSet instance has
the specified initial capacity and the specified load factor. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String e)
Adds the specified element to the set if it is not already present (optional
operation).
|
boolean |
addAll(Collection<? extends String> c)
Adds all of the elements in the specified collection to the set if they're not already
present (optional operation).
|
void |
clear()
Removes all of the elements from the set (optional operation).
|
boolean |
contains(Object o)
Returns
true if the set contains the specified element. |
boolean |
containsAll(Collection<?> c)
Returns
true if the set contains all of the elements of the specified
collection. |
boolean |
remove(Object o)
Removes the specified element from the set if it is present (optional operation).
|
boolean |
removeAll(Collection<?> c)
Removes from the set all of its elements that are contained in the specified collection
(optional operation).
|
boolean |
retainAll(Collection<?> c)
Retains only the elements in the set that are contained in the specified collection
(optional operation).
|
equals, hashCode, isEmpty, iterator, size, toArray, toArrayclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitspliteratorparallelStream, removeIf, streampublic CaseInsensitiveSet()
HashSet
with default initial capacity and load factor.public CaseInsensitiveSet(Collection<String> c)
HashSet is created with default load factor and an initial
capacity sufficient to contain the elements in the specified collection.c - the collection whose elements are to be placed into this set.NullPointerException - if the specified collection is null.public CaseInsensitiveSet(int initialCapacity,
float loadFactor)
HashSet instance has
the specified initial capacity and the specified load factor.initialCapacity - the initial capacity of the hash set.loadFactor - the load factor of the hash set.IllegalArgumentException - if the initial capacity is less than zero, or if the load factor is nonpositive.public CaseInsensitiveSet(int initialCapacity)
HashSet instance has
the specified initial capacity and default load factor.initialCapacity - the initial capacity of the hash set.IllegalArgumentException - if the initial capacity is less than zero.public boolean contains(Object o)
SetDecoratortrue if the set contains the specified element.contains in interface Collection<String>contains in interface Set<String>contains in class SetDecorator<String>o - element whose presence in the set is to be tested.true if the set contains the specified element.public boolean add(String e)
SetDecoratoradd in interface Collection<String>add in interface Set<String>add in class SetDecorator<String>e - element to be added to the set.true if the set did not already contain the specified element.public boolean remove(Object o)
SetDecoratorremove in interface Collection<String>remove in interface Set<String>remove in class SetDecorator<String>o - object to be removed from the set, if present.true if the set contained the specified element.public boolean containsAll(Collection<?> c)
SetDecoratortrue if the set contains all of the elements of the specified
collection.containsAll in interface Collection<String>containsAll in interface Set<String>containsAll in class SetDecorator<String>c - collection to be checked for containment in the set.true if the set contains all of the elements of the specified collection.public boolean addAll(Collection<? extends String> c)
SetDecoratoraddAll in interface Collection<String>addAll in interface Set<String>addAll in class SetDecorator<String>c - collection containing elements to be added to the set.true if the set changed as a result of the call.public boolean retainAll(Collection<?> c)
SetDecoratorretainAll in interface Collection<String>retainAll in interface Set<String>retainAll in class SetDecorator<String>c - collection containing elements to be retained in the set.true if the set changed as a result of the call.public boolean removeAll(Collection<?> c)
SetDecoratorremoveAll in interface Collection<String>removeAll in interface Set<String>removeAll in class SetDecorator<String>c - collection containing elements to be removed from the set.true if the set changed as a result of the call.public void clear()
SetDecoratorclear in interface Collection<String>clear in interface Set<String>clear in class SetDecorator<String>Copyright © 2025 Open Identity Platform Community. All rights reserved.