Package com.cobber.fta
Class PreSortedSet
- Object
-
- AbstractCollection<E>
-
- AbstractSet<E>
-
- HashSet<E>
-
- LinkedHashSet<String>
-
- PreSortedSet
-
- All Implemented Interfaces:
java.io.Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,Set<String>
,SortedSet<String>
public class PreSortedSet extends LinkedHashSet<String> implements SortedSet<String>
This set is basically a LinkedHashSet that implements the SortedSet interface. We fundamentally want a set that is Sorted but the sort order is defined by the order of insertion (i.e. the order is managed externally). None of the core SortedSet functionality is implemented, however, you can run through the elements in the correct order :-).- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comparator<? super String>
comparator()
String
first()
SortedSet<String>
headSet(String toElement)
String
last()
SortedSet<String>
subSet(String fromElement, String toElement)
SortedSet<String>
tailSet(String fromElement)
-
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
first
public String first()
- Specified by:
first
in interfaceSortedSet<String>
-
last
public String last()
- Specified by:
last
in interfaceSortedSet<String>
-
comparator
public Comparator<? super String> comparator()
- Specified by:
comparator
in interfaceSortedSet<String>
-
subSet
public SortedSet<String> subSet(String fromElement, String toElement)
- Specified by:
subSet
in interfaceSortedSet<String>
-
headSet
public SortedSet<String> headSet(String toElement)
- Specified by:
headSet
in interfaceSortedSet<String>
-
tailSet
public SortedSet<String> tailSet(String fromElement)
- Specified by:
tailSet
in interfaceSortedSet<String>
-
-