Package com.cedarsoftware.util
Class CaseInsensitiveSet<E>
java.lang.Object
com.cedarsoftware.util.CaseInsensitiveSet<E>
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
Implements a java.util.Set that will not utilize 'case' when comparing Strings
contained within the Set. The set can be homogeneous or heterogeneous.
If the CaseInsensitiveSet is iterated, when Strings are encountered, the original
Strings are returned (retains case).
- Author:
- John DeRegnaucourt ([email protected])
Copyright (c) Cedar Software LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
License
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
Constructor Summary
ConstructorsConstructorDescriptionCaseInsensitiveSet
(int initialCapacity) CaseInsensitiveSet
(int initialCapacity, float loadFactor) CaseInsensitiveSet
(Collection<? extends E> collection) CaseInsensitiveSet
(Collection<? extends E> source, Map backingMap) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
int
hashCode()
boolean
isEmpty()
iterator()
Deprecated.Deprecated.Deprecated.Deprecated.boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
Methods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
CaseInsensitiveSet
public CaseInsensitiveSet() -
CaseInsensitiveSet
-
CaseInsensitiveSet
-
CaseInsensitiveSet
public CaseInsensitiveSet(int initialCapacity) -
CaseInsensitiveSet
public CaseInsensitiveSet(int initialCapacity, float loadFactor)
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
-
addAll
-
retainAll
-
removeAll
-
clear
public void clear() -
minus
Deprecated. -
minus
Deprecated. -
plus
Deprecated. -
plus
Deprecated. -
toString
-