Class HashableMultiKey

java.lang.Object
com.espertech.esper.common.client.util.HashableMultiKey
All Implemented Interfaces:
MultiKey, Serializable

public final class HashableMultiKey extends Object implements Serializable, MultiKey
Multi-key made up of multiple values providing hashcode and equals semantics using Object.hashCode() and Arrays.equals(Object[], Object[])
See Also:
  • Field Details

    • EPTYPE

      public static final EPTypeClass EPTYPE
      Type information
  • Constructor Details

    • HashableMultiKey

      public HashableMultiKey(Object[] keys)
      Constructor for multiple keys supplied in an object array.
      Parameters:
      keys - is an array of key objects
    • HashableMultiKey

      public HashableMultiKey(Object key)
      Constructor for a single key object.
      Parameters:
      key - is the single key object
    • HashableMultiKey

      public HashableMultiKey(Object key1, Object key2)
      Constructor for a pair of key objects.
      Parameters:
      key1 - is the first key object
      key2 - is the second key object
    • HashableMultiKey

      public HashableMultiKey(Object key1, Object key2, Object key3)
      Constructor for three key objects.
      Parameters:
      key1 - is the first key object
      key2 - is the second key object
      key3 - is the third key object
    • HashableMultiKey

      public HashableMultiKey(Object key1, Object key2, Object key3, Object key4)
      Constructor for four key objects.
      Parameters:
      key1 - is the first key object
      key2 - is the second key object
      key3 - is the third key object
      key4 - is the fourth key object
  • Method Details

    • size

      public final int size()
      Returns the number of key objects.
      Returns:
      size of key object array
    • get

      public final Object get(int index)
      Returns the key object at the specified position.
      Parameters:
      index - is the array position
      Returns:
      key object at position
    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • getNumKeys

      public int getNumKeys()
      Description copied from interface: MultiKey
      Returns the number of keys available
      Specified by:
      getNumKeys in interface MultiKey
      Returns:
      number of keys
    • getKey

      public Object getKey(int num)
      Description copied from interface: MultiKey
      Returns the key value at the given index
      Specified by:
      getKey in interface MultiKey
      Parameters:
      num - key number
      Returns:
      key value
    • getKeys

      public Object[] getKeys()
      Returns keys.
      Returns:
      keys object array
    • hashCode

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

      public final String toString()
      Overrides:
      toString in class Object