org.makumba.list.engine
Class Grouper
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable
org.makumba.list.engine.Grouper
- All Implemented Interfaces:
- Serializable, Cloneable, Map
public class Grouper
- extends Hashtable
This class groups data coming in an Enumeration of Dictionaries. Grouping is done in more levels, each level is
defined by a set of keys of the dictionary. Elements of each group come in a Vector that is guaranteed to respect the
order in the original enumeration.
- Author:
- Cristian Bogdan
- See Also:
- Serialized Form
Method Summary |
Vector |
getData(Vector keyData)
Gets the Vector associated with the given keysets. |
protected MultipleKey |
getKey(int n,
Object[] data)
Get the bunch of values associated with the keyset with the given index |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
keyNameSets
Vector<Vector<Integer>> keyNameSets
max
int max
stack
Hashtable[] stack
keyStack
MultipleKey[] keyStack
Grouper
public Grouper(Vector<Vector<Integer>> keyNameSets,
Enumeration e)
- Groups the given data according to the given key sets.
- Parameters:
keyNameSets
- a Vector of Vectors of Strings that represents key namese
- the Enumeration of dictionaries containing the data
getData
public Vector getData(Vector keyData)
- Gets the Vector associated with the given keysets. The returned data is deleted from the Grouper.
- Parameters:
keyData
- a Vector of Dictionaries representing a set of key values each
- Returns:
- A Vector associated with the given keysets
getKey
protected MultipleKey getKey(int n,
Object[] data)
- Get the bunch of values associated with the keyset with the given index
- Parameters:
n
- the indexdata
- an object array containing the interesting data
- Returns:
- A MultipleKey holding the values