Schnittstelle ShortLongPair

Alle bekannten Implementierungsklassen:
ShortLongImmutablePair, ShortLongMutablePair

public interface ShortLongPair
Key Value Pair Interface that allows to reduce boxing/unboxing.
  • Felddetails

    • EMPTY

      static final ShortLongPair EMPTY
      Empty Reference for Immutable Pairs
  • Methodendetails

    • of

      static ShortLongPair of()
      Gibt zurück:
      empty Immutable Pair
    • ofKey

      static ShortLongPair ofKey(short key)
      Parameter:
      key - the key that should be in the pair
      Gibt zurück:
      Immutable Pair of Key
    • ofValue

      static ShortLongPair ofValue(long value)
      Parameter:
      value - the value that should be in the pair
      Gibt zurück:
      Immutable Pair of Value
    • of

      static ShortLongPair of(short key, long value)
      Parameter:
      key - the key that should be in the pair
      value - the value that should be in the pair
      Gibt zurück:
      Immutable Pair of key and value
    • of

      static ShortLongPair of(ShortLongPair pair)
      Parameter:
      pair - the Pair that should be immutably copied
      Gibt zurück:
      a Immutable Copy of the Provided Pair
    • mutable

      static ShortLongPair mutable()
      Gibt zurück:
      empty Mutable Pair
    • mutableKey

      static ShortLongPair mutableKey(short key)
      Parameter:
      key - the key that should be in the pair
      Gibt zurück:
      Mutable Pair of key
    • mutableValue

      static ShortLongPair mutableValue(long value)
      Parameter:
      value - the value that should be in the pair
      Gibt zurück:
      Mutable Pair of value
    • mutable

      static ShortLongPair mutable(short key, long value)
      Parameter:
      key - the key that should be in the pair
      value - the value that should be in the pair
      Gibt zurück:
      Mutable Pair of key and value
    • mutable

      static ShortLongPair mutable(ShortLongPair pair)
      Parameter:
      pair - the Pair that should be copied
      Gibt zurück:
      a Mutable Copy of the Provided Pair
    • setShortKey

      ShortLongPair setShortKey(short key)
      Sets the Key of the Pair.
      Parameter:
      key - the key that should be set.
      Gibt zurück:
      self or a new Pair instance with the new key.
    • getShortKey

      short getShortKey()
      Gibt zurück:
      the Key of the Pair
    • setLongValue

      ShortLongPair setLongValue(long value)
      Sets the Value of the Pair.
      Parameter:
      value - the value that should be set.
      Gibt zurück:
      self or a new Pair instance with the new value.
    • getLongValue

      long getLongValue()
      Gibt zurück:
      the Value of the Pair
    • set

      ShortLongPair set(short key, long value)
      Sets key and value of the Pair
      Parameter:
      key - the key that should be set.
      value - the value that should be set.
      Gibt zurück:
      self or a new Pair instance with the new key and value.
    • shallowCopy

      ShortLongPair shallowCopy()
      Clones the Pair if it is mutable.
      Gibt zurück:
      a New Mutable Instance if it is mutable