com.ephox.collections
Class CaseInsensitiveSet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<String>
com.ephox.collections.CaseInsensitiveSet
- All Implemented Interfaces:
- Iterable<String>, Collection<String>, Set<String>
public class CaseInsensitiveSet
- extends AbstractSet<String>
Implementation of HashSet
that lowercases all keys to provide case insensitive matching.
- Since:
- 7.5
CaseInsensitiveSet
public CaseInsensitiveSet()
CaseInsensitiveSet
public CaseInsensitiveSet(Collection<String> defaultItems)
- NOTE: Starting with version 8.0, this method copies the contents of defaultItems instead of using a reference.
add
public boolean add(String key)
- Specified by:
add
in interface Collection<String>
- Specified by:
add
in interface Set<String>
- Overrides:
add
in class AbstractCollection<String>
contains
public boolean contains(Object key)
- Specified by:
contains
in interface Collection<String>
- Specified by:
contains
in interface Set<String>
- Overrides:
contains
in class AbstractCollection<String>
contains
public boolean contains(String key)
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection<String>
- Specified by:
isEmpty
in interface Set<String>
- Overrides:
isEmpty
in class AbstractCollection<String>
clear
public void clear()
- Specified by:
clear
in interface Collection<String>
- Specified by:
clear
in interface Set<String>
- Overrides:
clear
in class AbstractCollection<String>
iterator
public Iterator<String> iterator()
- Specified by:
iterator
in interface Iterable<String>
- Specified by:
iterator
in interface Collection<String>
- Specified by:
iterator
in interface Set<String>
- Specified by:
iterator
in class AbstractCollection<String>
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection<String>
- Specified by:
remove
in interface Set<String>
- Overrides:
remove
in class AbstractCollection<String>
removeAll
public boolean removeAll(Collection<?> arg0)
- Specified by:
removeAll
in interface Collection<String>
- Specified by:
removeAll
in interface Set<String>
- Overrides:
removeAll
in class AbstractSet<String>
retainAll
public boolean retainAll(Collection<?> arg0)
- Specified by:
retainAll
in interface Collection<String>
- Specified by:
retainAll
in interface Set<String>
- Overrides:
retainAll
in class AbstractCollection<String>
size
public int size()
- Specified by:
size
in interface Collection<String>
- Specified by:
size
in interface Set<String>
- Specified by:
size
in class AbstractCollection<String>
toArray
public String[] toArray()
- Specified by:
toArray
in interface Collection<String>
- Specified by:
toArray
in interface Set<String>
- Overrides:
toArray
in class AbstractCollection<String>
toString
public String toString()
- Overrides:
toString
in class AbstractCollection<String>