gumbo.visualize.data
Class DataUtils

java.lang.Object
  |
  +--gumbo.visualize.data.DataUtils

public final class DataUtils
extends java.lang.Object

Constants and utilities related to data visualization. The main data visualization types span a range of abstraction. The term "up" refers to a one-to-one conversion from a lower to a higher level, and "down" refers to a possibly one-to-many conversion from a higher to a lower level. The abstraction levels, from highest to lowest, are as follows.

Version:
$Revision: 1.1 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Method Summary
static java.util.Collection downToDataModels(java.util.Collection group, java.util.Collection retVal)
          Gets the data models associated with a group of higher level objects.
static java.util.Collection downToDataViews(java.util.Collection group, java.util.Collection retVal)
          Gets the data views associated with a group of higher level objects.
static java.util.Collection downToGraphics(java.util.Collection group, java.util.Collection retVal)
          Gets the data views associated with a group of higher level objects.
static java.util.Collection downToGraphicViews(java.util.Collection group, java.util.Collection retVal)
          Gets the data views associated with a group of higher level objects.
static java.util.Collection findPartsInWholeModel(java.lang.Object clientId, WholeModel wholeModel, java.util.Collection retVal)
          Gets the part models in a whole model that have a given client ID.
static java.util.Collection findPartsInWholeView(PartModel partModel, WholeView wholeView, java.util.Collection retVal)
          Gets the part views in a whole view corresponding to a given part model.
static java.util.Map sortByWholeModel(java.util.Collection group, java.util.Map retVal)
          Sorts a group of parts (model, data view, graphic view) by the whole data model they belong to.
static java.util.Map sortByWholeView(java.util.Collection group, java.util.Map retVal)
          Sorts a group of part views (data view, graphic view) by the whole data view they belong to.
static java.util.Collection upToClientIds(java.util.Collection group, java.util.Collection retVal)
          Gets the client IDs associated with a group of lower level objects.
static java.util.Collection upToDataModels(java.util.Collection group, java.util.Collection retVal)
          Gets the data models associated with a group lower level of objects.
static java.util.Collection upToDataViews(java.util.Collection group, java.util.Collection retVal)
          Gets the data views associated with a group of lower level objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

upToClientIds

public static java.util.Collection upToClientIds(java.util.Collection group,
                                                 java.util.Collection retVal)
Gets the client IDs associated with a group of lower level objects.

Parameters:
group - The group of objects (GraphicView/DataView/DataModel). Never null.
retVal - Return value object. The client IDs (Object) in the iterator order of the group. Never null. Can be group.
Returns:
Reference to retVal. Never null.

upToDataModels

public static java.util.Collection upToDataModels(java.util.Collection group,
                                                  java.util.Collection retVal)
Gets the data models associated with a group lower level of objects.

Parameters:
group - The group of objects (GraphicView/DataView). Never null.
retVal - Return value object. The data models (DataModel) in the iterator order of the group. Never null. Can be group.
Returns:
Reference to retVal. Never null.

upToDataViews

public static java.util.Collection upToDataViews(java.util.Collection group,
                                                 java.util.Collection retVal)
Gets the data views associated with a group of lower level objects.

Parameters:
group - The group of objects (GraphicView). Never null.
retVal - Return value object. The data views (DataView) in the iterator order of the group. Never null. Can be group.
Returns:
Reference to retVal. Never null.

downToDataModels

public static java.util.Collection downToDataModels(java.util.Collection group,
                                                    java.util.Collection retVal)
Gets the data models associated with a group of higher level objects.

Parameters:
group - The group of objects (client IDs (Object)). Never null.
retVal - Return value object. The data models (DataModel) in the iterator order of the group. Never null. Can be group.
Returns:
Reference to retVal. Never null.

downToDataViews

public static java.util.Collection downToDataViews(java.util.Collection group,
                                                   java.util.Collection retVal)
Gets the data views associated with a group of higher level objects.

Parameters:
group - The group of objects (client IDs (Object)/DataModel). Never null.
retVal - Return value object. The data views (DataView) in the iterator order of the group. Never null. Can be group.
Returns:
Reference to retVal. Never null.

downToGraphicViews

public static java.util.Collection downToGraphicViews(java.util.Collection group,
                                                      java.util.Collection retVal)
Gets the data views associated with a group of higher level objects.

Parameters:
group - The group of objects (client IDs (Object)/DataModel/ DataView). Never null.
retVal - Return value object. The graphic views (GraphicView) in the iterator order of the group. Never null. Can be group.
Returns:
Reference to retVal. Never null.

downToGraphics

public static java.util.Collection downToGraphics(java.util.Collection group,
                                                  java.util.Collection retVal)
Gets the data views associated with a group of higher level objects.

Parameters:
group - The group of objects (client IDs (Object)/DataModel/ DataView/GraphicView). Never null.
retVal - Return value object. The graphic views (GraphicView) in the iterator order of the group. Never null. Can be group.
Returns:
Reference to retVal. Never null.

sortByWholeModel

public static java.util.Map sortByWholeModel(java.util.Collection group,
                                             java.util.Map retVal)
Sorts a group of parts (model, data view, graphic view) by the whole data model they belong to. Useful for mapping the leaves in a nested pick to their corresponding whole models.

Parameters:
group - The group of parts (PartModel/PartView/GraphicView). Never null. Ignores wholes. Throws an exception for any other type.
retVal - Return value object. The map of whole models (WholeModel) to sets (Set) of parts (PartModel/PartView/GraphicView). Never null.
Returns:
Reference to retVal. Never null.

sortByWholeView

public static java.util.Map sortByWholeView(java.util.Collection group,
                                            java.util.Map retVal)
Sorts a group of part views (data view, graphic view) by the whole data view they belong to. Useful for mapping the leaves in a nested pick to their corresponding whole views.

Parameters:
group - The group of views (DataView/GraphicView). Never null. Ignores whole views. Throws an exception for any other type.
retVal - Return value object. The map of whole views (WholeView) to sets (Set) of views (DataView/GraphicView). Never null.
Returns:
Reference to retVal. Never null.

findPartsInWholeModel

public static java.util.Collection findPartsInWholeModel(java.lang.Object clientId,
                                                         WholeModel wholeModel,
                                                         java.util.Collection retVal)
Gets the part models in a whole model that have a given client ID.

Parameters:
clientId - The client ID. Never null.
wholeModel - The whole model. Never null.
retVal - Return value object. The part models (PartModel). Never null.
Returns:
Reference to retVal. Never null.

findPartsInWholeView

public static java.util.Collection findPartsInWholeView(PartModel partModel,
                                                        WholeView wholeView,
                                                        java.util.Collection retVal)
Gets the part views in a whole view corresponding to a given part model.

Parameters:
partModel - The part model. Never null.
wholeView - The whole view. Never null.
retVal - Return value object. The part views (PartView). Never null.
Returns:
Reference to retVal. Never null.