info.rolandkrueger.roklib.util
Class TernarySearchTreeStringSet

java.lang.Object
  extended by info.rolandkrueger.roklib.util.TernarySearchTreeStringSet
All Implemented Interfaces:
Iterable<CharSequence>, Collection<CharSequence>, Set<CharSequence>, SortedSet<CharSequence>
Direct Known Subclasses:
SuggestionComboBoxDataset

public class TernarySearchTreeStringSet
extends Object
implements SortedSet<CharSequence>


Nested Class Summary
private static class TernarySearchTreeStringSet.TSTStringSetSubSet
           
 
Field Summary
private static Object MARKER
           
private  TernarySearchTreeMap<Object> mData
           
 
Constructor Summary
TernarySearchTreeStringSet()
           
TernarySearchTreeStringSet(CharSequence[] values)
           
TernarySearchTreeStringSet(Set<CharSequence> values)
           
 
Method Summary
 boolean add(CharSequence key)
           
 boolean addAll(Collection<? extends CharSequence> collection)
           
 void clear()
           
 Comparator<? super CharSequence> comparator()
           
private  int compare(CharSequence k1, CharSequence k2)
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> collection)
           
 boolean equals(Object obj)
           
 CharSequence first()
           
 int hashCode()
           
 SortedSet<CharSequence> headSet(CharSequence toElement)
           
 boolean isEmpty()
           
 Iterator<CharSequence> iterator()
           
 CharSequence last()
           
 boolean remove(Object key)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 int size()
           
 SortedSet<CharSequence> subSet(CharSequence fromElement, CharSequence toElement)
           
 SortedSet<CharSequence> tailSet(CharSequence fromElement)
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MARKER

private static Object MARKER

mData

private TernarySearchTreeMap<Object> mData
Constructor Detail

TernarySearchTreeStringSet

public TernarySearchTreeStringSet()

TernarySearchTreeStringSet

public TernarySearchTreeStringSet(CharSequence[] values)

TernarySearchTreeStringSet

public TernarySearchTreeStringSet(Set<CharSequence> values)
Method Detail

comparator

public Comparator<? super CharSequence> comparator()
Specified by:
comparator in interface SortedSet<CharSequence>

first

public CharSequence first()
Specified by:
first in interface SortedSet<CharSequence>

headSet

public SortedSet<CharSequence> headSet(CharSequence toElement)
Specified by:
headSet in interface SortedSet<CharSequence>

last

public CharSequence last()
Specified by:
last in interface SortedSet<CharSequence>

subSet

public SortedSet<CharSequence> subSet(CharSequence fromElement,
                                      CharSequence toElement)
Specified by:
subSet in interface SortedSet<CharSequence>

tailSet

public SortedSet<CharSequence> tailSet(CharSequence fromElement)
Specified by:
tailSet in interface SortedSet<CharSequence>

add

public boolean add(CharSequence key)
Specified by:
add in interface Collection<CharSequence>
Specified by:
add in interface Set<CharSequence>

addAll

public boolean addAll(Collection<? extends CharSequence> collection)
Specified by:
addAll in interface Collection<CharSequence>
Specified by:
addAll in interface Set<CharSequence>

clear

public void clear()
Specified by:
clear in interface Collection<CharSequence>
Specified by:
clear in interface Set<CharSequence>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<CharSequence>
Specified by:
contains in interface Set<CharSequence>

containsAll

public boolean containsAll(Collection<?> collection)
Specified by:
containsAll in interface Collection<CharSequence>
Specified by:
containsAll in interface Set<CharSequence>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<CharSequence>
Specified by:
isEmpty in interface Set<CharSequence>

iterator

public Iterator<CharSequence> iterator()
Specified by:
iterator in interface Iterable<CharSequence>
Specified by:
iterator in interface Collection<CharSequence>
Specified by:
iterator in interface Set<CharSequence>

remove

public boolean remove(Object key)
Specified by:
remove in interface Collection<CharSequence>
Specified by:
remove in interface Set<CharSequence>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<CharSequence>
Specified by:
removeAll in interface Set<CharSequence>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<CharSequence>
Specified by:
retainAll in interface Set<CharSequence>

size

public int size()
Specified by:
size in interface Collection<CharSequence>
Specified by:
size in interface Set<CharSequence>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<CharSequence>
Specified by:
toArray in interface Set<CharSequence>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<CharSequence>
Specified by:
toArray in interface Set<CharSequence>

equals

public boolean equals(Object obj)
Specified by:
equals in interface Collection<CharSequence>
Specified by:
equals in interface Set<CharSequence>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<CharSequence>
Specified by:
hashCode in interface Set<CharSequence>
Overrides:
hashCode in class Object

compare

private int compare(CharSequence k1,
                    CharSequence k2)


Copyright © 2007-2011. All Rights Reserved.