org.spaceroots.mantissa.utilities
Class MappableScalar
- java.lang.Object
-
- org.spaceroots.mantissa.utilities.MappableScalar
-
- All Implemented Interfaces:
- ArraySliceMappable
public class MappableScalar extends java.lang.Object implements ArraySliceMappable
Wrapper class around a scalar in order to have it implement theArraySliceMappableinterface.
-
-
Constructor Summary
Constructors Constructor and Description MappableScalar()Simple constructor.MappableScalar(double value)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetStateDimension()Get the dimension of the internal array.doublegetValue()Get the value stored in the instance.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.voidsetValue(double value)Set the value stored in the instance.
-
-
-
Constructor Detail
-
MappableScalar
public MappableScalar()
Simple constructor. Build a mappable scalar
-
MappableScalar
public MappableScalar(double value)
Simple constructor. Build a mappable scalar from its initial value- Parameters:
value- initial value of the scalar
-
-
Method Detail
-
getValue
public double getValue()
Get the value stored in the instance.- Returns:
- value stored in the instance
-
setValue
public void setValue(double value)
Set the value stored in the instance.- Parameters:
value- value to store in the instance
-
getStateDimension
public int getStateDimension()
Get the dimension of the internal array.- Specified by:
getStateDimensionin interfaceArraySliceMappable- Returns:
- dimension of the array (always 1 for this class)
-
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