uk.co.agena.minerva.util.model
Class DataSetGrouping

java.lang.Object
  extended by uk.co.agena.minerva.util.model.DataSetGrouping
All Implemented Interfaces:
Identifiable

public class DataSetGrouping
extends java.lang.Object
implements Identifiable

The DataSetGrouping class encapsulates a set of DataSet objects. DataSetGroupings can be used to store multiple sets of marginal probabilities.

For example, a prediction might contain marginal probabilities for ExtendedStates 1 to 5 in three ExtendedNodes: A, B and C. The probability for each ExtendedState would be stored in a DataPoint. These DataPoints would be collected into a DataSet for each ExtendedNode. The entire prediction for all three nodes would then consist of a DataSetGrouping holding all three DataSets.


Constructor Summary
DataSetGrouping()
          Default constructor.
DataSetGrouping(NameDescription name, int connObjectId)
          Constructs a DataSetGrouping with the specified name and connected object ID.
 
Method Summary
 void addDataSet(DataSet dataSet)
          Adds the supplied DataSet to the DataSetGrouping.
 void addDataSet(DataSet dataSet, int orderPos)
          Adds the supplied DataSet to the DataSetGrouping at the specified order position.
 void clearDataSets()
          Clears all the DataSets in this DataSetGrouping.
 int getConnObjectId()
          Returns the connected object ID of the DataSetGrouping.
 java.util.List getDataSets()
          Returns all of the DataSets in this DataSetGrouping.
 java.util.List getDataSetsForConnObject(int connObjectId)
          Returns the DataSets associated with the specified connected object ID from this DataSetGrouping.
 DataSet getDataSetWithId(int id)
          Returns the DataSet with the specified ID from this DataSetGrouping.
 int getId()
          Returns the unique ID of the DataSetGrouping.
 NameDescription getName()
          Returns the name of the DataSetGrouping.
 int getNextDataSetId()
          Finds the next available ID to assign to a DataSet based on the IDs of DataSets currently in the DataSetGrouping.
 java.util.List removeDataSetsForConnObject(int connObjId)
          Removes the DataSets associated with the specified connected object ID from this DataSetGrouping.
 DataSet removeDataSetWithId(int id)
          Removes the DataSets with the specified ID from this DataSetGrouping.
 void setConnObjectId(int connObjectId)
          Sets the connected object ID of the DataSetGrouping to the ID specified.
 void setDataSets(java.util.List dataSets)
          Assigns the supplied List of DataSets to this DataSetGrouping.
 void setId(int id)
          Sets the unique ID of the DataSetGrouping to the ID specified.
 void setName(NameDescription name)
          Sets the name of the DataSetGrouping to the name specified.
 java.lang.String toString()
          Returns a String representation of this DataSetGrouping which consists of its name and String representations of the DataSets contained in it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSetGrouping

public DataSetGrouping()
Default constructor.


DataSetGrouping

public DataSetGrouping(NameDescription name,
                       int connObjectId)
Constructs a DataSetGrouping with the specified name and connected object ID.

Parameters:
name - the name of the DataSetGrouping
connObjectId - the ID of the object with which the DataSetGrouping is associated
Method Detail

getConnObjectId

public int getConnObjectId()
Returns the connected object ID of the DataSetGrouping.

Returns:
the connected object ID of the DataSetGrouping

setConnObjectId

public void setConnObjectId(int connObjectId)
Sets the connected object ID of the DataSetGrouping to the ID specified.

Parameters:
connObjectId - the new connected object ID for the DataSetGrouping

getId

public int getId()
Returns the unique ID of the DataSetGrouping.

Specified by:
getId in interface Identifiable
Returns:
the unique ID of the DataSetGrouping

setId

public void setId(int id)
Sets the unique ID of the DataSetGrouping to the ID specified.

Parameters:
id - the new ID for the DataSetGrouping

getName

public NameDescription getName()
Returns the name of the DataSetGrouping.

Returns:
the name of the DataSetGrouping

setName

public void setName(NameDescription name)
Sets the name of the DataSetGrouping to the name specified.

Parameters:
name - the new name for the DataSetGrouping

getDataSets

public java.util.List getDataSets()
Returns all of the DataSets in this DataSetGrouping.

Returns:
a List of all DataSets in this DataSetGrouping

setDataSets

public void setDataSets(java.util.List dataSets)
Assigns the supplied List of DataSets to this DataSetGrouping. The ID of each DataSet is changed to fit in with the DataSetGrouping's internal numbering scheme.

Parameters:
dataSets - the new List of DataSets

addDataSet

public void addDataSet(DataSet dataSet)
Adds the supplied DataSet to the DataSetGrouping. The ID of the DataSet will be changed to fit in with the numbering scheme used by the DataSetGrouping.

Parameters:
dataSet - the DataSet to be added

addDataSet

public void addDataSet(DataSet dataSet,
                       int orderPos)
Adds the supplied DataSet to the DataSetGrouping at the specified order position. The ID of the DataSet will be changed to fit in with the numbering scheme used by the DataSetGrouping.

Parameters:
dataSet - the DataSet to be added
orderPos - the position where the DataSet is to be added

getNextDataSetId

public int getNextDataSetId()
Finds the next available ID to assign to a DataSet based on the IDs of DataSets currently in the DataSetGrouping.

Returns:
the next available ID

getDataSetWithId

public DataSet getDataSetWithId(int id)
                         throws MinervaIDException
Returns the DataSet with the specified ID from this DataSetGrouping.

Parameters:
id - the unique identifier of the DataSet
Returns:
the DataSet with the specified ID
Throws:
MinervaIDException - if a DataSet with the specified ID does not exist

getDataSetsForConnObject

public java.util.List getDataSetsForConnObject(int connObjectId)
                                        throws MinervaIDException
Returns the DataSets associated with the specified connected object ID from this DataSetGrouping.

Parameters:
connObjectId - the unique identifier of the object with which the DataSets are associated
Returns:
the List of DataSets associated with the connected object
Throws:
MinervaIDException - if a DataSet with the specified connected object ID does not exist

removeDataSetWithId

public DataSet removeDataSetWithId(int id)
                            throws MinervaIDException
Removes the DataSets with the specified ID from this DataSetGrouping.

Parameters:
id - the unique identifier of the DataSets to be removed
Returns:
the DataSet removed
Throws:
MinervaIDException - if a DataSet with the specified ID does not exist

removeDataSetsForConnObject

public java.util.List removeDataSetsForConnObject(int connObjId)
                                           throws MinervaIDException
Removes the DataSets associated with the specified connected object ID from this DataSetGrouping.

Parameters:
connObjId - the unique identifier of the object with which the DataSets are associated
Returns:
the List of DataSets removed
Throws:
MinervaIDException - if a DataSet with the specified connected object ID does not exist

clearDataSets

public void clearDataSets()
Clears all the DataSets in this DataSetGrouping.


toString

public java.lang.String toString()
Returns a String representation of this DataSetGrouping which consists of its name and String representations of the DataSets contained in it.

Overrides:
toString in class java.lang.Object


Copyright © 2006 Agena Ltd. All Rights Reserved.