org.jgap.audit
Class KeyedValues
- java.lang.Object
-
- org.jgap.audit.KeyedValues
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, ICloneable
public class KeyedValues extends java.lang.Object implements ICloneable, java.io.Serializable
A collection of (key, value) tupels- Since:
- 2.3
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description KeyedValues()Creates a new collection (initially empty).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()booleanequals(java.lang.Object a_obj)Tests if this object is equal to anotherintgetIndex(java.lang.Comparable a_key)java.lang.ComparablegetKey(int a_index)java.util.ListgetKeys()Returns the keys for the values in the collectionjava.lang.NumbergetValue(java.lang.Comparable a_key)Returns the value for a given key.java.lang.NumbergetValue(int a_index)inthashCode()voidsetValue(java.lang.Comparable a_key, java.lang.Number a_value)Updates an existing value, or adds a new value to the collectionintsize()
-
-
-
Constructor Detail
-
KeyedValues
public KeyedValues()
Creates a new collection (initially empty).- Since:
- 2.3
-
-
Method Detail
-
size
public int size()
- Returns:
- number of items in the collection
- Since:
- 2.3
-
getValue
public java.lang.Number getValue(int a_index)
- Parameters:
a_index- the index of the item to return the value for- Returns:
- the value at given index
- Since:
- 2.3
-
getKey
public java.lang.Comparable getKey(int a_index)
- Parameters:
a_index- the item index to retrieve the key for, starting at 0- Returns:
- the row key for item at given index
- Since:
- 2.3
-
getIndex
public int getIndex(java.lang.Comparable a_key)
- Parameters:
a_key- the key to search for- Returns:
- index for a given key or -1 if the key is not found
- Since:
- 2.3
-
getKeys
public java.util.List getKeys()
Returns the keys for the values in the collection- Returns:
- The keys (never null)
- Since:
- 2.3
-
getValue
public java.lang.Number getValue(java.lang.Comparable a_key)
Returns the value for a given key. For unknown keys, null is returned- Parameters:
a_key- the key- Returns:
- the value for the key
- Since:
- 2.3
-
setValue
public void setValue(java.lang.Comparable a_key, java.lang.Number a_value)Updates an existing value, or adds a new value to the collection- Parameters:
a_key- the keya_value- the value- Since:
- 2.3
-
equals
public boolean equals(java.lang.Object a_obj)
Tests if this object is equal to another- Overrides:
equalsin classjava.lang.Object- Parameters:
a_obj- the other object- Returns:
- true: this object is equal to the other one
- Since:
- 2.3
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- Returns:
- hash code of the instance
- Since:
- 2.3
-
clone
public java.lang.Object clone()
- Specified by:
clonein interfaceICloneable- Overrides:
clonein classjava.lang.Object- Returns:
- clone of the current instance
- Since:
- 2.3
-
-
DMelt 3.0 © DataMelt by jWork.ORG