com.quadrique.jbuildingblocks.core.dataStructure
Class JbbIntLabelToIndexMap
java.lang.Object
com.quadrique.jbuildingblocks.core.dataStructure.JbbIntLabelToIndexMap
public class JbbIntLabelToIndexMap
- extends Object
A simple data structures that maintains a map between a set of label and their numeric value.
It can typically be used to perform some translation/indirection i.e. to convert from fixed numeric values and their actual index
JbbIntLabelToIndexMap
public JbbIntLabelToIndexMap()
addLabelValues
public void addLabelValues(ArrayList<JbbIntLabelIntValue> labelValues)
throws Exception
- This is a convenience method to initialize the map by providing a list of IntLabelIntValue instances
- Parameters:
labelValues -
- Throws:
Exception
clear
public void clear()
add
public void add(int label,
int index)
throws Exception
- Parameters:
label - index -
- Throws:
Exception
getIndex
public int getIndex(int label)
throws Exception
- Parameters:
label -
- Returns:
- the index associated to the label
- Throws:
Exception - if there is no such label in the map
Copyright © 2001-2008 Quadrique Corporation. All Rights Reserved.