Class MapItem<Key,Value>

java.lang.Object
dsa.lib.DSAObject
dsa.lab04.base.MapItem<Key,Value>
Type Parameters:
Key - the key type
Value - the value type
All Implemented Interfaces:
dsa.lib.DSAInterface

public class MapItem<Key,Value> extends dsa.lib.DSAObject
An item in a map.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    MapItem(Key key, Value value)
    Construct a map item.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object that)
     
    int
     
    key()
    Get the key (the unique/identifying part of the item).
    toString(String indent)
     
    Get the value (the rest of the item, or the corresponding value, depending on your view).

    Methods inherited from class dsa.lib.DSAObject

    toDebugString, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MapItem

      public MapItem(Key key, Value value)
      Construct a map item.
      Parameters:
      key - the key
      value - the value
  • Method Details

    • key

      public Key key()
      Get the key (the unique/identifying part of the item).
      Returns:
      the key
    • value

      public Value value()
      Get the value (the rest of the item, or the corresponding value, depending on your view).
      Returns:
      the value
    • equals

      public boolean equals(Object that)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString(String indent)