Package org.planit.data
Class MultiKeyPlanItData
- java.lang.Object
-
- org.planit.data.MultiKeyPlanItData
-
public class MultiKeyPlanItData extends Object
Class which holds arrays of output property values, identified by arrays of output keys This class is a wrapper for the MultiKeyMap object which is a Map with multiple keys. This class has input and output methods which are specific to PlanIt output properties.- Author:
- gman6028
-
-
Constructor Summary
Constructors Constructor Description MultiKeyPlanItData(OutputProperty[] outputKeyProperties, OutputProperty... outputValueProperties)ConstructorMultiKeyPlanItData(OutputProperty outputKeyProperty1, OutputProperty... outputValueProperties)ConstructorMultiKeyPlanItData(OutputProperty outputKeyProperty1, OutputProperty outputKeyProperty2, OutputProperty... outputValueProperties)ConstructorMultiKeyPlanItData(OutputProperty outputKeyProperty1, OutputProperty outputKeyProperty2, OutputProperty outputKeyProperty3, OutputProperty... outputValueProperties)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiKeyPlanItDataIteratorgetIterator()Returns a MultiKeyPlanItDataIterator for the contents of this mapintgetPositionOfOutputKeyProperty(OutputProperty outputKeyProperty)Get the position of a property type in the output keys property arrayintgetPositionOfOutputValueProperty(OutputProperty outputValueProperty)Get the position of a property type in the output values property arrayObjectgetRowValue(OutputProperty outputProperty, Object... keyValues)Get data value for a specified row and columnObject[]getRowValues(Object... keyValues)Returns an array representing the row of data values defined by the specified array of key valuesvoidputRow(Object[] outputValues, Object... keyValues)Puts the data values into a specified rowvoidputRowValue(OutputProperty outputProperty, Object value, Object... keyValues)Set the data value for an individual cell
-
-
-
Constructor Detail
-
MultiKeyPlanItData
public MultiKeyPlanItData(OutputProperty[] outputKeyProperties, OutputProperty... outputValueProperties) throws PlanItException
Constructor- Parameters:
outputKeyProperties- OutputProperty types of keysoutputValueProperties- OutputProperty types of values- Throws:
PlanItException- thrown if there is an error
-
MultiKeyPlanItData
public MultiKeyPlanItData(OutputProperty outputKeyProperty1, OutputProperty... outputValueProperties) throws PlanItException
Constructor- Parameters:
outputKeyProperty1- first output key propertyoutputValueProperties- OutputProperty types of values- Throws:
PlanItException- thrown if there is an error
-
MultiKeyPlanItData
public MultiKeyPlanItData(OutputProperty outputKeyProperty1, OutputProperty outputKeyProperty2, OutputProperty... outputValueProperties) throws PlanItException
Constructor- Parameters:
outputKeyProperty1- first output key propertyoutputKeyProperty2- second output key propertyoutputValueProperties- OutputProperty types of values- Throws:
PlanItException- thrown if there is an error
-
MultiKeyPlanItData
public MultiKeyPlanItData(OutputProperty outputKeyProperty1, OutputProperty outputKeyProperty2, OutputProperty outputKeyProperty3, OutputProperty... outputValueProperties) throws PlanItException
Constructor- Parameters:
outputKeyProperty1- first output key propertyoutputKeyProperty2- second output key propertyoutputKeyProperty3- third output key propertyoutputValueProperties- OutputProperty types of values- Throws:
PlanItException- thrown if there is an error
-
-
Method Detail
-
getRowValues
public Object[] getRowValues(Object... keyValues) throws PlanItException
Returns an array representing the row of data values defined by the specified array of key values- Parameters:
keyValues- array storing the key values- Returns:
- array storing the data values
- Throws:
PlanItException- thrown if the key values array is invalid
-
getRowValue
public Object getRowValue(OutputProperty outputProperty, Object... keyValues) throws PlanItException
Get data value for a specified row and column- Parameters:
outputProperty- output property of the required columnkeyValues- array storing the key values- Returns:
- the value of the specified cell
- Throws:
PlanItException- thrown if there is an error
-
putRow
public void putRow(Object[] outputValues, Object... keyValues) throws PlanItException
Puts the data values into a specified row- Parameters:
outputValues- array storing the data valueskeyValues- array storing the key values to specify a row- Throws:
PlanItException- thrown if there is an error
-
putRowValue
public void putRowValue(OutputProperty outputProperty, Object value, Object... keyValues) throws PlanItException
Set the data value for an individual cell- Parameters:
outputProperty- output property value specifying the columnvalue- data value to be insertedkeyValues- array of key values specifying the row- Throws:
PlanItException- thrown if there is an error
-
getIterator
public MultiKeyPlanItDataIterator getIterator()
Returns a MultiKeyPlanItDataIterator for the contents of this map- Returns:
- MultiKeyPlanItDataIterator which loops through the keys and values of this map
-
getPositionOfOutputValueProperty
public int getPositionOfOutputValueProperty(OutputProperty outputValueProperty) throws PlanItException
Get the position of a property type in the output values property array- Parameters:
outputValueProperty- the output value property- Returns:
- the position of the output value property in the output values property array
- Throws:
PlanItException- thrown if the output property type is not in the output values property array
-
getPositionOfOutputKeyProperty
public int getPositionOfOutputKeyProperty(OutputProperty outputKeyProperty) throws PlanItException
Get the position of a property type in the output keys property array- Parameters:
outputKeyProperty- the output value property- Returns:
- the position of the output key property in the output keys property array
- Throws:
PlanItException- thrown if the output property type is not in the output keys property array
-
-