Class Entry<Key,Value>

java.lang.Object
com.iu.javadatastructureslab.datastructures.Entry<Key,Value>
Type Parameters:
Key - key type
Value - value type

public class Entry<Key,Value> extends Object
Represents a key/value pair stored in ArrayMap.
  • Constructor Details

    • Entry

      public Entry(Key key, Value value)
      Creates a new entry with the given key and value.
      Parameters:
      key - entry key
      value - entry value
  • Method Details

    • setValue

      public void setValue(Value value)
      Updates the value for this entry.
      Parameters:
      value - new value
    • setKey

      public void setKey(Key key)
      Updates the key for this entry.
      Parameters:
      key - new key
    • getKey

      public Key getKey()
      Returns the entry key.
      Returns:
      key value
    • getValue

      public Value getValue()
      Returns the entry value.
      Returns:
      entry value
    • toString

      public String toString()
      Returns a string representation of the entry.
      Overrides:
      toString in class Object
      Returns:
      string representation