com.ephox.collections
Class CaseInsensitiveSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<String>
          extended by 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

Constructor Summary
CaseInsensitiveSet()
           
CaseInsensitiveSet(Collection<String> defaultItems)
          NOTE: Starting with version 8.0, this method copies the contents of defaultItems instead of using a reference.
 
Method Summary
 boolean add(String key)
           
 void clear()
           
 boolean contains(Object key)
           
 boolean contains(String key)
           
 boolean isEmpty()
           
 Iterator<String> iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> arg0)
           
 boolean retainAll(Collection<?> arg0)
           
 int size()
           
 String[] toArray()
           
 String toString()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, toArray
 

Constructor Detail

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.

Method Detail

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>

Copyright (c) 2005-2012 Ephox Pty Ltd. All rights reserved.