com.espertech.esper.collection
Class MultiKeyUntyped

java.lang.Object
  extended by com.espertech.esper.collection.MultiKeyUntyped
All Implemented Interfaces:
MetaDefItem, java.io.Serializable

public final class MultiKeyUntyped
extends java.lang.Object
implements MetaDefItem, java.io.Serializable

Functions as a key value for Maps where keys need to be composite values. The class allows a Map that uses MultiKeyUntyped entries for key values to use multiple objects as keys. It calculates the hashCode from the key objects on construction and caches the hashCode.

See Also:
Serialized Form

Constructor Summary
MultiKeyUntyped(java.lang.Object key)
          Constructor for a single key object.
MultiKeyUntyped(java.lang.Object[] keys)
          Constructor for multiple keys supplied in an object array.
MultiKeyUntyped(java.lang.Object key1, java.lang.Object key2)
          Constructor for a pair of key objects.
MultiKeyUntyped(java.lang.Object key1, java.lang.Object key2, java.lang.Object key3)
          Constructor for three key objects.
MultiKeyUntyped(java.lang.Object key1, java.lang.Object key2, java.lang.Object key3, java.lang.Object key4)
          Constructor for four key objects.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.Object get(int index)
          Returns the key object at the specified position.
 java.lang.Object[] getKeys()
          Returns keys.
 int hashCode()
           
 int size()
          Returns the number of key objects.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiKeyUntyped

public MultiKeyUntyped(java.lang.Object[] keys)
Constructor for multiple keys supplied in an object array.

Parameters:
keys - is an array of key objects

MultiKeyUntyped

public MultiKeyUntyped(java.lang.Object key)
Constructor for a single key object.

Parameters:
key - is the single key object

MultiKeyUntyped

public MultiKeyUntyped(java.lang.Object key1,
                       java.lang.Object key2)
Constructor for a pair of key objects.

Parameters:
key1 - is the first key object
key2 - is the second key object

MultiKeyUntyped

public MultiKeyUntyped(java.lang.Object key1,
                       java.lang.Object key2,
                       java.lang.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

MultiKeyUntyped

public MultiKeyUntyped(java.lang.Object key1,
                       java.lang.Object key2,
                       java.lang.Object key3,
                       java.lang.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 Detail

size

public final int size()
Returns the number of key objects.

Returns:
size of key object array

get

public final java.lang.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(java.lang.Object other)
Overrides:
equals in class java.lang.Object

getKeys

public java.lang.Object[] getKeys()
Returns keys.

Returns:
keys object array

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com