com.jniwrapper
Class AbstractFloat

java.lang.Object
  extended by com.jniwrapper.Parameter
      extended by com.jniwrapper.AbstractFloat
All Implemented Interfaces:
FloatParameter
Direct Known Subclasses:
DoubleFloat, LongDouble, SingleFloat

public abstract class AbstractFloat
extends Parameter
implements FloatParameter

Base class for all floating-point types.


Field Summary
 
Fields inherited from class com.jniwrapper.Parameter
LICENSE_TYPE, V
 
Constructor Summary
protected AbstractFloat(double val, int length)
          Constructs a floating-point object with a specified value and the length equal to its native length in bytes.
 
Method Summary
protected abstract  byte[] convertToBytes(double d)
          Converts Java double value to its native representation.
protected abstract  double convertToDouble(byte[] bytes)
          Converts native representation of a floating-point value to Java double value.
 java.lang.String getDebugInfo()
          Return debug info for JNIWrapper parameter.
 int getLength()
          Returns the length of the parameter in memory.
 double getValue()
          Returns a floating-point value of the object instance.
 void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Reads this parameter from a specified data source.
 void setValue(double d)
          Sets a floating-point value to a specified value.
 java.lang.String toString()
           
 void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback)
          Writes this parameter to a specified data source.
 
Methods inherited from class com.jniwrapper.Parameter
acceptIOPerformer, asReturnValue, clone, dataBufferAssigned, equals, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, hashCode, indent, pop, push, read, read, setDataBuffer, toByteArray, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractFloat

protected AbstractFloat(double val,
                        int length)
Constructs a floating-point object with a specified value and the length equal to its native length in bytes.

Method Detail

getLength

public int getLength()
Description copied from class: Parameter
Returns the length of the parameter in memory. This method is similar to C sizeof() operator.

Specified by:
getLength in class Parameter

write

public void write(DataBuffer stackBuffer,
                  int offset,
                  boolean invokedByCallback)
           throws MemoryAccessViolationException
Description copied from class: Parameter
Writes this parameter to a specified data source.

Specified by:
write in class Parameter
Throws:
MemoryAccessViolationException

read

public void read(DataBuffer stackBuffer,
                 int offset,
                 boolean invokedByCallback)
          throws MemoryAccessViolationException
Description copied from class: Parameter
Reads this parameter from a specified data source.

Specified by:
read in class Parameter
Throws:
MemoryAccessViolationException

getValue

public double getValue()
Description copied from interface: FloatParameter
Returns a floating-point value of the object instance.

Specified by:
getValue in interface FloatParameter

convertToDouble

protected abstract double convertToDouble(byte[] bytes)
Converts native representation of a floating-point value to Java double value.


convertToBytes

protected abstract byte[] convertToBytes(double d)
Converts Java double value to its native representation.


setValue

public void setValue(double d)
Description copied from interface: FloatParameter
Sets a floating-point value to a specified value.

Specified by:
setValue in interface FloatParameter

getDebugInfo

public java.lang.String getDebugInfo()
Description copied from class: Parameter
Return debug info for JNIWrapper parameter.

Specified by:
getDebugInfo in class Parameter
Returns:
debug info

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object