edu.jhu.tmaj.beans.data
Class ExpandingMap

java.lang.Object
  extended by edu.jhu.tmaj.beans.data.ExpandingMap
All Implemented Interfaces:
java.io.Serializable

public final class ExpandingMap
extends java.lang.Object
implements java.io.Serializable

Here is how an expanding map works: An expanding map actually keeps track of a LIST of maps. (not just one map). For each of the maps, the keys are the fields, and the values are the field's value. So for example, ONE Map in the Map list may contain these values: SpecimenID -> 74191 SurgPathNumber -> S65-99412 HospitalID -> 2 Notes -> My Notes Lets say one of the fields, SpecimenID, is set up as an Expandable Field. SubMaps contain more information about the Expandable field. As you can see, the map above has a value of 74191 recorded for SpecimenID. The specmenID submap may have more information on this. For example, this may have been added to the subMap: addSubMapValue(SPECIMENID_KEY, 74191, "GleasonGradePrimary, "3"); addSubMapValue(SPECIMENID_KEY, 74191, "GleasonGradeSecondary, "2"); addSubMapValue(SPECIMENID_KEY, 555, "GleasonGradePrimary, "5"); // The third addSubMapValue is not relevant because the specimenID is not 74191 When the method expandMaps() is called, the values in the subMaps will be put into the appropriate maps in mapList. So now, the Map mentioned above will have: SpecimenID -> 74191 SurgPathNumber -> S65-99412 HospitalID -> 2 Notes -> My Notes GleasonGradePrimary -> 3 GleasonGradeSecondary -> 2 The reason this class is implemented is because data found in the subMaps is often repeated several times in the main list of maps found in this class. So in the above example, the SpecimenID#74191 would be found several times in the list of Maps. (This is somewhat of a bad example because it looks like each Map in the list of Maps represents one specimen, so this class would offer no benefit. If you imagine that the SpecimenIDs are repeated several times, then you see the benefit as this class would save space. )

See Also:
Serialized Form

Constructor Summary
ExpandingMap(java.lang.Object[] expandableFields)
           
 
Method Summary
 void addMap(java.util.Map field_value)
           
 void addSubMapValue(java.lang.Object expandingField, int id, java.lang.Object extraField, java.lang.Object value)
           
 void expandMaps()
           
 java.util.List<java.util.Map> getMapList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpandingMap

public ExpandingMap(java.lang.Object[] expandableFields)
Method Detail

addMap

public void addMap(java.util.Map field_value)

getMapList

public java.util.List<java.util.Map> getMapList()

expandMaps

public void expandMaps()

addSubMapValue

public void addSubMapValue(java.lang.Object expandingField,
                           int id,
                           java.lang.Object extraField,
                           java.lang.Object value)