Class LongLongHashedList

  • All Implemented Interfaces:
    java.io.Serializable

    public class LongLongHashedList
    extends java.lang.Object
    implements java.io.Serializable
    Class that maps a long key to a list of longs.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      LongLongHashedList()
      Constructs a new LongLongHashedList with a default capacity.
      LongLongHashedList​(int capacity)
      Constructs a new LongLongHashedList with a given capacity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(long key, long value)
      Adds the given value to list associated with the given key.
      void append​(long key, long value)
      Appends the given value to list associated with the given key.
      void clear()
      Removes all values from all keys.
      boolean contains​(long key, long value)
      Tests if the given value is in the list of values associated with the given key.
      long[] get​(long key)
      Returns the array of int values associated with the given key.
      long[] getKeys()
      Returns the list of keys.
      boolean remove​(long key, long value)
      Removes the int value from the list associated with the given key.
      void removeAll​(long key)
      Removes all the values in the list associated with the given key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LongLongHashedList

        public LongLongHashedList()
        Constructs a new LongLongHashedList with a default capacity.
      • LongLongHashedList

        public LongLongHashedList​(int capacity)
        Constructs a new LongLongHashedList with a given capacity.
        Parameters:
        capacity - the initial capacity
    • Method Detail

      • getKeys

        public long[] getKeys()
        Returns the list of keys.
      • add

        public void add​(long key,
                        long value)
        Adds the given value to list associated with the given key.
        Parameters:
        key - key to be associated with the given value.
        value - the value to associate with the given key.
      • append

        public void append​(long key,
                           long value)
        Appends the given value to list associated with the given key.
        Parameters:
        key - key to be associated with the given value.
        value - the value to associate with the given key.
      • contains

        public boolean contains​(long key,
                                long value)
        Tests if the given value is in the list of values associated with the given key.
        Parameters:
        key - key whose list is to be searched for the given value.
        value - the value to be searched for in the list associated with the key.
      • get

        public long[] get​(long key)
        Returns the array of int values associated with the given key.
        Parameters:
        key - the key for which to return a set of associated values.
      • remove

        public boolean remove​(long key,
                              long value)
        Removes the int value from the list associated with the given key.
        Parameters:
        key - the key associated with a list of values from which to remove the given value.
        value - the value to be removed from the list of values associated with the given key.
      • removeAll

        public void removeAll​(long key)
        Removes all the values in the list associated with the given key.
        Parameters:
        key - the key whose list of values should be cleared.
      • clear

        public void clear()
        Removes all values from all keys.