goldman.collection.tagged.ordered.digitized
Class TaggedDigitizedOrderedCollectionWrapper<T,E>

java.lang.Object
  extended by goldman.collection.tagged.TaggedCollectionWrapper<T,E>
      extended by goldman.collection.tagged.ordered.TaggedOrderedCollectionWrapper<T,E>
          extended by goldman.collection.tagged.ordered.digitized.TaggedDigitizedOrderedCollectionWrapper<T,E>
All Implemented Interfaces:
TaggedDigitizedOrderedCollection<T,E>, TaggedOrderedCollection<T,E>, TaggedCollection<T,E>, TrackedTagged<T,E>, Iterable<TaggedElement<T,E>>
Direct Known Subclasses:
TaggedCompactTrie, TaggedCompressedTrie, TaggedPatriciaTrie, TaggedTernarySearchTrie, TaggedTrie

public abstract class TaggedDigitizedOrderedCollectionWrapper<T,E>
extends TaggedOrderedCollectionWrapper<T,E>
implements TaggedDigitizedOrderedCollection<T,E>, TrackedTagged<T,E>

The tagged ordered collection wrapper can wrap any digitized ordered collection implementation, where each element in the collection is a tagged element. It is required that the comparator depends only on the tag, and the tag is immutable.


Field Summary
 
Fields inherited from class goldman.collection.tagged.TaggedCollectionWrapper
pairs, target
 
Constructor Summary
TaggedDigitizedOrderedCollectionWrapper(DigitizedOrderedCollection<TaggedElement<T,E>> pairs)
           
 
Method Summary
 void completions(T prefix, Collection<? super TaggedElement<T,E>> tc)
          Adds to the provided tagged collection, tc, all tagged elements for which the tag has the given prefix.
 void longestCommonPrefix(T tag, Collection<? super TaggedElement<T,E>> tc)
          Adds to the provided tagged collection, tc, all tagged elements in this collection whose tag has a longest common prefix with tag.
 
Methods inherited from class goldman.collection.tagged.ordered.TaggedOrderedCollectionWrapper
iteratorAtEnd, max, min, predecessor, putTracked, successor
 
Methods inherited from class goldman.collection.tagged.TaggedCollectionWrapper
accept, clear, contains, elements, ensureCapacity, get, getCapacity, getLocator, getSize, isEmpty, iterator, put, putAll, remove, tags, toString, trimToSize, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface goldman.collection.tagged.ordered.TaggedOrderedCollection
iteratorAtEnd, max, min, predecessor, successor
 
Methods inherited from interface goldman.collection.tagged.TaggedCollection
accept, clear, contains, elements, ensureCapacity, get, getCapacity, getLocator, getSize, isEmpty, iterator, put, putAll, remove, tags, toString, trimToSize, values
 
Methods inherited from interface goldman.collection.tagged.TrackedTagged
putTracked
 

Constructor Detail

TaggedDigitizedOrderedCollectionWrapper

public TaggedDigitizedOrderedCollectionWrapper(DigitizedOrderedCollection<TaggedElement<T,E>> pairs)
Method Detail

completions

public void completions(T prefix,
                        Collection<? super TaggedElement<T,E>> tc)
Description copied from interface: TaggedDigitizedOrderedCollection
Adds to the provided tagged collection, tc, all tagged elements for which the tag has the given prefix. (We consider a tag to be a prefix of itself.)

Specified by:
completions in interface TaggedDigitizedOrderedCollection<T,E>
Parameters:
prefix - the desired prefix
tc - the tagged collection to append all tagged elements for which the tag has the given prefix

longestCommonPrefix

public void longestCommonPrefix(T tag,
                                Collection<? super TaggedElement<T,E>> tc)
Description copied from interface: TaggedDigitizedOrderedCollection
Adds to the provided tagged collection, tc, all tagged elements in this collection whose tag has a longest common prefix with tag.

Specified by:
longestCommonPrefix in interface TaggedDigitizedOrderedCollection<T,E>
Parameters:
tag - the desired prefix
tc - the tagged collection to append all tagged elements in this collection where the tag has a longest common prefix with tag.