Class TLcdPair<K,V>

java.lang.Object
com.luciad.util.TLcdPair<K,V>
Type Parameters:
K - the key type
V - the value type

public class TLcdPair<K,V> extends Object
A simple key-value pair. Instances of this class are immutable, thus thread-safe.
  • Constructor Details

    • TLcdPair

      public TLcdPair(K aKey, V aValue)
      Creates a new key-value pair.
      Parameters:
      aKey - the key
      aValue - the value
  • Method Details

    • getKey

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

      public V getValue()
      Gets the value.
      Returns:
      the value
    • hashCode

      public int hashCode()
      Computes the hash code for this pair.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code for this pair.
    • equals

      public boolean equals(Object aObj)
      Checks a given object for equality. Returns false if the given object is null or not a pair.
      Overrides:
      equals in class Object
      Parameters:
      aObj - an object to check for equality
      Returns:
      true if both key and value are equal, false otherwise
    • toString

      public String toString()
      Creates a string representation of this pair.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this pair