Class PreSortedSet

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.String>, java.util.Collection<java.lang.String>, java.util.Set<java.lang.String>, java.util.SortedSet<java.lang.String>

    public class PreSortedSet
    extends java.util.LinkedHashSet<java.lang.String>
    implements java.util.SortedSet<java.lang.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
      java.util.Comparator<? super java.lang.String> comparator()  
      java.lang.String first()  
      java.util.SortedSet<java.lang.String> headSet​(java.lang.String toElement)  
      java.lang.String last()  
      java.util.SortedSet<java.lang.String> subSet​(java.lang.String fromElement, java.lang.String toElement)  
      java.util.SortedSet<java.lang.String> tailSet​(java.lang.String fromElement)  
      • Methods inherited from class java.util.LinkedHashSet

        spliterator
      • Methods inherited from class java.util.HashSet

        add, clear, clone, contains, isEmpty, iterator, remove, size
      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • 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
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
      • Methods inherited from interface java.util.SortedSet

        spliterator
    • Method Detail

      • first

        public java.lang.String first()
        Specified by:
        first in interface java.util.SortedSet<java.lang.String>
      • last

        public java.lang.String last()
        Specified by:
        last in interface java.util.SortedSet<java.lang.String>
      • comparator

        public java.util.Comparator<? super java.lang.String> comparator()
        Specified by:
        comparator in interface java.util.SortedSet<java.lang.String>
      • subSet

        public java.util.SortedSet<java.lang.String> subSet​(java.lang.String fromElement,
                                                            java.lang.String toElement)
        Specified by:
        subSet in interface java.util.SortedSet<java.lang.String>
      • headSet

        public java.util.SortedSet<java.lang.String> headSet​(java.lang.String toElement)
        Specified by:
        headSet in interface java.util.SortedSet<java.lang.String>
      • tailSet

        public java.util.SortedSet<java.lang.String> tailSet​(java.lang.String fromElement)
        Specified by:
        tailSet in interface java.util.SortedSet<java.lang.String>