org.spaceroots.mantissa.utilities
Class MappableArray
- java.lang.Object
-
- org.spaceroots.mantissa.utilities.MappableArray
-
- All Implemented Interfaces:
- ArraySliceMappable
public class MappableArray extends java.lang.Object implements ArraySliceMappable
Wrapper class around an array in order to have it implement theArraySliceMappableinterface.
-
-
Constructor Summary
Constructors Constructor and Description MappableArray(double[] array)Simple constructor.MappableArray(int dimension)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]getArray()Get the array stored in the instance.intgetStateDimension()Get the dimension of the internal array.voidmapStateFromArray(int start, double[] array)Reinitialize internal state from the specified array slice data.voidmapStateToArray(int start, double[] array)Store internal state data into the specified array slice.
-
-
-
Constructor Detail
-
MappableArray
public MappableArray(int dimension)
Simple constructor. Build a mappable array from its dimension- Parameters:
dimension- dimension of the array
-
MappableArray
public MappableArray(double[] array)
Simple constructor. Build a mappable array from an existing array- Parameters:
array- array to use
-
-
Method Detail
-
getArray
public double[] getArray()
Get the array stored in the instance.- Returns:
- array stored in the instance
-
getStateDimension
public int getStateDimension()
Get the dimension of the internal array.- Specified by:
getStateDimensionin interfaceArraySliceMappable- Returns:
- dimension of the array
-
mapStateFromArray
public void mapStateFromArray(int start, double[] array)Reinitialize internal state from the specified array slice data.- Specified by:
mapStateFromArrayin interfaceArraySliceMappable- Parameters:
start- start index in the arrayarray- array holding the data to extract
-
mapStateToArray
public void mapStateToArray(int start, double[] array)Store internal state data into the specified array slice.- Specified by:
mapStateToArrayin interfaceArraySliceMappable- Parameters:
start- start index in the arrayarray- array where data should be stored
-
-
DataMelt 3.0 © DataMelt by jWork.ORG