org.makumba.commons
Class MultipleKey

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<Object>
              extended by org.makumba.commons.MultipleKey
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess

public class MultipleKey
extends Vector<Object>
implements Serializable

Holds the values for a group of fields. Every element of a MultipleKey holds an Object. In case of a null value being passed to one of the constructors, the element is replaced by a placeholder.

Version:
$Id: MultipleKey.java 5125 2010-05-18 17:57:27Z rosso_nero $
Author:
Cristian Bogdan
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
MultipleKey(int size)
           
MultipleKey(Object... o)
           
MultipleKey(Object[] o, int size)
           
MultipleKey(Vector<Object> v)
           
MultipleKey(Vector<Object> keys, Dictionary<String,Object> data)
          Keeps together the values associated with the give keys
MultipleKey(Vector<Object> keys, Dictionary<String,Object> data, int size)
          Keeps together the values associated with the given keys
MultipleKey(Vector<Object> v, int size)
           
MultipleKey(Vector<Object> v, Object o)
          Extends the Vector v and adds the object
MultipleKey(Vector<Object> indexes, Object[] data)
          Keeps together the values associated with the given keys
MultipleKey(Vector<Object> indexes, Object[] data, int size)
          Keep together the values associated with the given keys
 
Method Summary
protected  Object checkNull(Object o)
           
 boolean equals(Object o)
          Compares the elements of two MultipleKey objects
 int hashCode()
          Computes a hash code of the MultipleKey by adding the individual hashcodes of each element
 void setAt(Object o, int n)
           
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, firstElement, get, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

MultipleKey

public MultipleKey(int size)

MultipleKey

public MultipleKey(Vector<Object> v)

MultipleKey

public MultipleKey(Vector<Object> v,
                   int size)

MultipleKey

public MultipleKey(Vector<Object> v,
                   Object o)
Extends the Vector v and adds the object

Parameters:
v - An instance of Vector
o - An object to be added

MultipleKey

public MultipleKey(Object... o)

MultipleKey

public MultipleKey(Object[] o,
                   int size)

MultipleKey

public MultipleKey(Vector<Object> keys,
                   Dictionary<String,Object> data)
Keeps together the values associated with the give keys

Parameters:
keys - A vector of keys
data - The dictionary containing the values of the keys

MultipleKey

public MultipleKey(Vector<Object> keys,
                   Dictionary<String,Object> data,
                   int size)
Keeps together the values associated with the given keys

Parameters:
keys - A vector of keys
data - The dictionary containing the values of the keys
size - The size of the MultipleKey object to be constructed

MultipleKey

public MultipleKey(Vector<Object> indexes,
                   Object[] data)
Keeps together the values associated with the given keys

Parameters:
indexes - A vector of keys
data - The object array containing the values of the keys

MultipleKey

public MultipleKey(Vector<Object> indexes,
                   Object[] data,
                   int size)
Keep together the values associated with the given keys

Parameters:
indexes - A vector of keys
data - The object array containing the values of the keys
size - The size of the MultipleKey object to be constructed
Method Detail

setAt

public void setAt(Object o,
                  int n)

checkNull

protected Object checkNull(Object o)

equals

public boolean equals(Object o)
Compares the elements of two MultipleKey objects

Specified by:
equals in interface Collection<Object>
Specified by:
equals in interface List<Object>
Overrides:
equals in class Vector<Object>
Parameters:
o - The object to be compared with

hashCode

public int hashCode()
Computes a hash code of the MultipleKey by adding the individual hashcodes of each element

Specified by:
hashCode in interface Collection<Object>
Specified by:
hashCode in interface List<Object>
Overrides:
hashCode in class Vector<Object>
Returns:
The hashcode of the MultipleKey