com.quadrique.jbuildingblocks.core.dataStructure
Class JbbStringLabelToIndexMap

java.lang.Object
  extended by com.quadrique.jbuildingblocks.core.dataStructure.JbbStringLabelToIndexMap

public class JbbStringLabelToIndexMap
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 type of column name to column index conversion.


Method Summary
 void add(String label, int index)
           
 void addLabels(ArrayList<String> labels)
          This is a convenience method to initialize the map by providing a list of labels by column order (e.g.
 void addLabelValues(ArrayList<JbbStringLabelIntValue> labelValues)
          This is a convenience method to initialize the map by providing a list of LabelIntValue instances
 void clear()
           
 int getIndex(String label)
           
static JbbStringLabelToIndexMap newInstance()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static JbbStringLabelToIndexMap newInstance()

addLabels

public void addLabels(ArrayList<String> labels)
               throws Exception
This is a convenience method to initialize the map by providing a list of labels by column order (e.g. first label is the name of the column...)

Parameters:
labels -
Throws:
Exception

addLabelValues

public void addLabelValues(ArrayList<JbbStringLabelIntValue> labelValues)
                    throws Exception
This is a convenience method to initialize the map by providing a list of LabelIntValue instances

Parameters:
labelValues -
Throws:
Exception

clear

public void clear()

add

public void add(String label,
                int index)
         throws Exception
Parameters:
label -
index -
Throws:
Exception

getIndex

public int getIndex(String 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.