Class Entry<K,V>

java.lang.Object
dev.tylermong.customhashmap.Entry<K,V>
Type Parameters:
K - the type of the key
V - the type of the value

public class Entry<K,V> extends Object
This class represents an entry in the custom hash map. It uses generics to allow for any type of key and value.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private K
    The key of the entry, which can be of any type.
    private V
    The value of the entry, which can be of any type.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Entry(K key, V value)
    Constructs an entry with the specified key and value.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the key of the entry.
    Returns the value of the entry.
    void
    setValue(V value)
    Sets the value of the entry.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • key

      private K key
      The key of the entry, which can be of any type.
    • value

      private V value
      The value of the entry, which can be of any type.
  • Constructor Details

    • Entry

      public Entry(K key, V value)
      Constructs an entry with the specified key and value.
      Parameters:
      key - the key of the entry
      value - the value of the entry
  • Method Details

    • getKey

      public K getKey()
      Returns the key of the entry.
      Returns:
      the key of the entry
    • getValue

      public V getValue()
      Returns the value of the entry.
      Returns:
      the value of the entry
    • setValue

      public void setValue(V value)
      Sets the value of the entry.
      Parameters:
      value - the value to set