Package nom.tam.util

Class HashedList<VALUE extends CursorValue<java.lang.String>>

  • Type Parameters:
    VALUE - value of the map
    All Implemented Interfaces:
    java.lang.Iterable<VALUE>, java.util.Collection<VALUE>

    public class HashedList<VALUE extends CursorValue<java.lang.String>>
    extends java.lang.Object
    implements java.util.Collection<VALUE>
    a ordered hash map implementation.
    • Constructor Summary

      Constructors 
      Constructor Description
      HashedList()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(VALUE e)  
      boolean addAll​(java.util.Collection<? extends VALUE> c)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> c)  
      boolean containsKey​(java.lang.Object key)  
      VALUE get​(int n)  
      VALUE get​(java.lang.Object key)  
      boolean isEmpty()  
      nom.tam.util.HashedList.HashedListIterator iterator()  
      Cursor<java.lang.String,​VALUE> iterator​(int n)  
      nom.tam.util.HashedList.HashedListIterator iterator​(java.lang.String key)  
      boolean remove​(int index)
      Remove an object from the list giving the object index..
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean removeKey​(java.lang.Object key)
      Remove a keyed object from the list.
      boolean replaceKey​(java.lang.String oldKey, java.lang.String newKey)
      Replace the key of a given element.
      boolean retainAll​(java.util.Collection<?> c)  
      int size()  
      void sort​(java.util.Comparator<java.lang.String> comp)
      Sort the keys into some desired order.
      java.lang.Object[] toArray()  
      <T> T[] toArray​(T[] o)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

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

        forEach
    • Constructor Detail

      • HashedList

        public HashedList()
    • Method Detail

      • add

        public boolean add​(VALUE e)
        Specified by:
        add in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • addAll

        public boolean addAll​(java.util.Collection<? extends VALUE> c)
        Specified by:
        addAll in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Parameters:
        key - the key to search
        Returns:
        true if the key is included in the list.
      • get

        public VALUE get​(int n)
        Parameters:
        n - the index to get
        Returns:
        the n'th entry from the beginning.
      • get

        public VALUE get​(java.lang.Object key)
        Parameters:
        key - the key to search for
        Returns:
        the value of a keyed entry. Non-keyed entries may be returned by requesting an iterator.
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • iterator

        public nom.tam.util.HashedList.HashedListIterator iterator()
        Specified by:
        iterator in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
        Specified by:
        iterator in interface java.lang.Iterable<VALUE extends CursorValue<java.lang.String>>
        Returns:
        a HashedListIterator over the entire list.
      • iterator

        public Cursor<java.lang.String,​VALUE> iterator​(int n)
        Parameters:
        n - the index to start the iterator
        Returns:
        an iterator starting with the n'th entry.
      • iterator

        public nom.tam.util.HashedList.HashedListIterator iterator​(java.lang.String key)
        Parameters:
        key - the key to use as a start point
        Returns:
        an iterator over the list starting with the entry with a given key.
      • remove

        public boolean remove​(int index)
        Remove an object from the list giving the object index..
        Parameters:
        index - the index to remove
        Returns:
        true if the index was in range
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • removeKey

        public boolean removeKey​(java.lang.Object key)
        Remove a keyed object from the list. Unkeyed objects can be removed from the list using a HashedListIterator or using the remove(Object) method.
        Parameters:
        key - the key to remove
        Returns:
        true if the key was removed
      • replaceKey

        public boolean replaceKey​(java.lang.String oldKey,
                                  java.lang.String newKey)
        Replace the key of a given element.
        Parameters:
        oldKey - The previous key. This key must be present in the hash.
        newKey - The new key. This key must not be present in the hash.
        Returns:
        if the replacement was successful.
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • sort

        public void sort​(java.util.Comparator<java.lang.String> comp)
        Sort the keys into some desired order.
        Parameters:
        comp - the comparator to use for the sorting
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • toArray

        public <T> T[] toArray​(T[] o)
        Specified by:
        toArray in interface java.util.Collection<VALUE extends CursorValue<java.lang.String>>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object