peakml.io
Class SetInfo

java.lang.Object
  extended by peakml.io.SetInfo

public class SetInfo
extends java.lang.Object

Central point for collecting all information about a set. A set combines multiple measurements with a logical relationship (eg technical replicates). In order to do this, measurement id's are stored in the class. The Header class provides access methods for easily retrieval of the MeasurementInfo instances.


Field Summary
static int BIOLOGICAL_REPLICATES
          Type indicating that this set is used to combine biological replicates (either files or sets)
static int SET
          Type indicating that this set is used to combine other sets
static int TECHNICAL_REPLICATES
          Type indicating that this set is used to combine technical replicates (either files or sets)
 
Constructor Summary
SetInfo(SetInfo setinfo)
          Copy constructor, which makes a deep copy of the given SetInfo instance.
SetInfo(java.lang.String id, int type, int... measurementids)
          Constructs a new set with the given id, type and measurement id's.
 
Method Summary
 void addChild(SetInfo child)
          Adds the given set as a child to this set.
 void addMeasurementID(int id)
          Adds the given measurement id to the list of id's.
 boolean containsMeasurementID(int id)
          Returns true when the given id is associated to this set (including all the child sets).
 java.util.Vector<java.lang.Integer> getAllMeasurementIDs()
          Returns a list of all the measurement id's associated with this set (including all the child sets).
 SetInfo getChild(int index)
          Returns the child at the given index.
 java.util.Vector<SetInfo> getChildren()
          Returns the list with all the children.
 java.lang.String getID()
          Returns the id of this set.
 int getMeasurementID(int index)
          Returns the measurement id at the given index in this set information.
 java.util.Vector<java.lang.Integer> getMeasurementIDs()
          Returns a list of all the measurement id's associated with this set (excluding all the child sets).
 int getNrChildren()
          Returns the number of children in this set.
 int getNrMeasurementIDs()
          Returns the number of measurement id's associated to this set.
 int getType()
          Returns the type of this set.
 boolean getVisible()
          For more information see setVisible(boolean).
 void setVisible(boolean b)
          Convenience function for user interface applications to keep track off whether to show this set or not.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SET

public static int SET
Type indicating that this set is used to combine other sets


TECHNICAL_REPLICATES

public static int TECHNICAL_REPLICATES
Type indicating that this set is used to combine technical replicates (either files or sets)


BIOLOGICAL_REPLICATES

public static int BIOLOGICAL_REPLICATES
Type indicating that this set is used to combine biological replicates (either files or sets)

Constructor Detail

SetInfo

public SetInfo(java.lang.String id,
               int type,
               int... measurementids)
Constructs a new set with the given id, type and measurement id's.

Parameters:
id - The id of the set.
type - The type of the set.
measurementids - The measurement id's to associate to the set.

SetInfo

public SetInfo(SetInfo setinfo)
Copy constructor, which makes a deep copy of the given SetInfo instance.

Parameters:
setinfo - The instance to copy.
Method Detail

getID

public java.lang.String getID()
Returns the id of this set.

Returns:
The id of the set.

getType

public int getType()
Returns the type of this set.

Returns:
The type of the set.

setVisible

public void setVisible(boolean b)
Convenience function for user interface applications to keep track off whether to show this set or not.

Parameters:
b - Boolean indicating show or not.

getVisible

public boolean getVisible()
For more information see setVisible(boolean).

Returns:
Boolean indicating show or not.

addChild

public void addChild(SetInfo child)
Adds the given set as a child to this set.

Parameters:
child - The set to be added as a child.

getNrChildren

public int getNrChildren()
Returns the number of children in this set.

Returns:
The number of children in this set.

getChild

public SetInfo getChild(int index)
                 throws java.lang.IndexOutOfBoundsException
Returns the child at the given index. When the index is not applicable to the list of children an index out of bounds exception is thrown.

Parameters:
index - The index where the child is located.
Returns:
The child at the given index.
Throws:
java.lang.IndexOutOfBoundsException - Thrown when the given index is out of bounds for the list of children.

getChildren

public java.util.Vector<SetInfo> getChildren()
Returns the list with all the children.

Returns:
The list with all the children.

addMeasurementID

public void addMeasurementID(int id)
Adds the given measurement id to the list of id's.

Parameters:
id - The integer measurement id to be added to this set.

getMeasurementIDs

public java.util.Vector<java.lang.Integer> getMeasurementIDs()
Returns a list of all the measurement id's associated with this set (excluding all the child sets).

Returns:
The list of the measurement id's associated to this set.

getMeasurementID

public int getMeasurementID(int index)
Returns the measurement id at the given index in this set information.

Parameters:
index - The index of the measurement info.
Returns:
The measurement id at the given index.

getNrMeasurementIDs

public int getNrMeasurementIDs()
Returns the number of measurement id's associated to this set.

Returns:
The number of measurement id's.

getAllMeasurementIDs

public java.util.Vector<java.lang.Integer> getAllMeasurementIDs()
Returns a list of all the measurement id's associated with this set (including all the child sets).

Returns:
The list of the measurement id's associated to this set.

containsMeasurementID

public boolean containsMeasurementID(int id)
Returns true when the given id is associated to this set (including all the child sets).

Parameters:
id - The measurement id to check for.
Returns:
True when the id is associated to this set, false otherwise.