org.spaceroots.mantissa.utilities
Class ArrayMapper
- java.lang.Object
-
- org.spaceroots.mantissa.utilities.ArrayMapper
-
public class ArrayMapper extends java.lang.ObjectThis class dispatch data between an array and several domain objects. This class handles all the burden of mapping each domain object it handles to a slice of a single array.- See Also:
ArraySliceMappable
-
-
Constructor Summary
Constructors Constructor and Description ArrayMapper()Simple constructor.ArrayMapper(ArraySliceMappable object)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]getDataArray()Get the data array.voidmanageMappable(ArraySliceMappable object)Take a new domain object into account.voidupdateArray()Map data from the domain objects to the internal array.voidupdateArray(double[] data)Map data from the domain objects to the specified array.voidupdateObjects()Map data from the internal array to the domain objects.voidupdateObjects(double[] data)Map data from the specified array to the domain objects.
-
-
-
Constructor Detail
-
ArrayMapper
public ArrayMapper()
Simple constructor. Build an empty array mapper
-
ArrayMapper
public ArrayMapper(ArraySliceMappable object)
Simple constructor. Build an array mapper managing one object. Other objects can be added later using themanageMappablemethod. This call is equivalent to build the mapper with the default constructor and adding the object.- Parameters:
object- domain object to handle
-
-
Method Detail
-
manageMappable
public void manageMappable(ArraySliceMappable object)
Take a new domain object into account.- Parameters:
object- domain object to handle
-
getDataArray
public double[] getDataArray()
Get the data array.- Returns:
- copy of the data array
-
updateObjects
public void updateObjects()
Map data from the internal array to the domain objects.
-
updateObjects
public void updateObjects(double[] data)
Map data from the specified array to the domain objects.- Parameters:
data- flat array holding the data to dispatch
-
updateArray
public void updateArray()
Map data from the domain objects to the internal array.
-
updateArray
public void updateArray(double[] data)
Map data from the domain objects to the specified array.- Parameters:
data- flat array where to put the data
-
-
DataMelt 3.0 © DataMelt by jWork.ORG