data
Class Design

java.lang.Object
  extended by data.Design
All Implemented Interfaces:
java.io.Serializable

public class Design
extends java.lang.Object
implements java.io.Serializable

A Design represents a row in the DataSheet. It stores the values for each Parameter of the dataSheet.

See Also:
Serialized Form

Field Summary
private  java.util.Hashtable<Filter,java.lang.Boolean> activationMap
          is used to store the information is the design is filtered.
private  Cluster cluster
          The cluster to which the design belongs.
private  int id
          The design id.
private  boolean insideBounds
          is used to store the information whether the design is within the bounds of all axes.
private  java.util.Hashtable<Parameter,java.lang.String> parameterValues
          The parameter values.
(package private) static boolean printLog
          Flag to enable debug message printing for this class.
(package private) static long serialVersionUID
          The version tracking unique identifier for Serialization.
 
Constructor Summary
Design(int id)
          Instantiates a new design.
 
Method Summary
 void evaluateBounds(Chart chart)
          Checks whether the design is within the bounds of all axes of the given Chart and updates the boolean field insideBounds accordingly.
 Cluster getCluster()
          Gets the cluster to which the design belongs.
 double getDoubleValue(Parameter param)
          Gets the numeric (double) representation of a value for a given parameter.
 int getId()
          Gets the id of the design.
 java.lang.String getStringValue(Parameter param)
          Gets the String representation of a value for a given parameter.
 boolean isActive(Chart chart)
          Checks whether the design is active.
private  boolean isInsideBounds(Axis axis)
          Checks if the design is inside the bounds for a given Axis.
 boolean isInsideBounds(Chart chart)
          Returns the value of the boolean field insideBounds.
private  void log(java.lang.String message)
          Prints debug information to stdout when printLog is set to true.
 void removeParameter(Parameter param)
          Removes a parameter from the design
 void setActive(Filter filter, boolean active)
          Specifies whether the design is still active after applying a given Filter.
 void setCluster(Cluster cluster)
          Sets the cluster.
 void setId(int id)
          Sets the id of the design.
 void setValue(Parameter param, java.lang.String parameterValue)
          Sets the value for a given parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
The version tracking unique identifier for Serialization.

See Also:
Constant Field Values

printLog

static final boolean printLog
Flag to enable debug message printing for this class.

See Also:
Constant Field Values

parameterValues

private java.util.Hashtable<Parameter,java.lang.String> parameterValues
The parameter values.


id

private int id
The design id.


cluster

private Cluster cluster
The cluster to which the design belongs.


activationMap

private java.util.Hashtable<Filter,java.lang.Boolean> activationMap
is used to store the information is the design is filtered. Information is kept for each Filter individually. Each Filter is responsible for updating this Hashtable himself. This makes the code a little less secure but yields significant benefits in terms of performance because this way the design must only be checked with respect to a Filter that is currently being modified. .


insideBounds

private boolean insideBounds
is used to store the information whether the design is within the bounds of all axes. If it is not is will not be displayed. This information could be evaluated every time it is needed, but storing it and only updating it when axis bound change is more efficient.

Constructor Detail

Design

public Design(int id)
Instantiates a new design.

Parameters:
id - the design id
Method Detail

setValue

public void setValue(Parameter param,
                     java.lang.String parameterValue)
Sets the value for a given parameter.

Parameters:
param - the parameter for which the value should be set
parameterValue - the parameter value

getDoubleValue

public double getDoubleValue(Parameter param)
Gets the numeric (double) representation of a value for a given parameter.

Parameters:
param - the parameter for which the value should be returned.
Returns:
the parameter value
Throws:
java.lang.IllegalArgumentException - if the parameter is unknown to the design.

getStringValue

public java.lang.String getStringValue(Parameter param)
Gets the String representation of a value for a given parameter.

Parameters:
param - the parameter for which the value should be returned.
Returns:
the string value for the given parameter
Throws:
java.lang.IllegalArgumentException - if the parameter is unknown to the design.

removeParameter

public void removeParameter(Parameter param)
Removes a parameter from the design

Parameters:
param - the parameter to be removed.
Throws:
java.lang.IllegalArgumentException - if the parameter is unknown to the design.

isActive

public boolean isActive(Chart chart)
Checks whether the design is active.

This check is carried out by looking up each filter in the activationMap

Parameters:
chart - the chart
Returns:
true, if the design is active

setActive

public void setActive(Filter filter,
                      boolean active)
Specifies whether the design is still active after applying a given Filter.

Parameters:
filter - the filter
active - the active

evaluateBounds

public void evaluateBounds(Chart chart)
Checks whether the design is within the bounds of all axes of the given Chart and updates the boolean field insideBounds accordingly.

Makes use of isInsideBounds for each Axis and returns false if isInsideBounds returns false for any Axis.

Parameters:
chart - the chart

isInsideBounds

private boolean isInsideBounds(Axis axis)
Checks if the design is inside the bounds for a given Axis.

Parameters:
axis - the axis
Returns:
true, if is inside bounds

isInsideBounds

public boolean isInsideBounds(Chart chart)
Returns the value of the boolean field insideBounds.

Parameters:
chart - the chart
Returns:
true, if the design is inside all axis bounds on the given chart.

getId

public int getId()
Gets the id of the design.

Returns:
the id

setId

public void setId(int id)
Sets the id of the design.

Parameters:
id - the new id

log

private void log(java.lang.String message)
Prints debug information to stdout when printLog is set to true.

Parameters:
message - the message

getCluster

public Cluster getCluster()
Gets the cluster to which the design belongs.

Returns:
the cluster

setCluster

public void setCluster(Cluster cluster)
Sets the cluster.

Parameters:
cluster - the new cluster to which the design belongs.