Class LongIntHashedList

  • All Implemented Interfaces:
    java.io.Serializable

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(long key, int value)
      Adds the given value to list associated with the given key.
      void append​(long key, int value)
      Appends the given value to list associated with the given key.
      void clear()
      Removes all values from all keys.
      boolean contains​(long key, int value)
      Tests if the given value is in the list of values associated with the given key.
      int[] get​(long key)
      Returns the array of int values associated with the given key.
      boolean remove​(long key, int 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

      • LongIntHashedList

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

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

      • add

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

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

        public boolean contains​(long key,
                                int 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 int[] 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,
                              int value)
        Removes the int value from the list associated with the given key.
        Parameters:
        key - the key associated with a list of valus 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.