Class FloatRequest
java.lang.Object
com.mouseviator.fsuipc.datarequest.DataRequest
com.mouseviator.fsuipc.datarequest.primitives.FloatRequest
- All Implemented Interfaces:
IDataRequest<java.lang.Float>
public class FloatRequest extends DataRequest implements IDataRequest<java.lang.Float>
This class implements short data request for use with
FSUIPC class. The internal byte data buffer length will be 4 bytes (32 bit), matching
FSUIPC 32bit signed floating point value. If you are familiar with FSUIPC lua functions, or other data type marking, this will match data that you can
read in lua with readFLT function.- Author:
- Mouseviator
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mouseviator.fsuipc.datarequest.IDataRequest
IDataRequest.RequestType -
Field Summary
Fields inherited from class com.mouseviator.fsuipc.datarequest.DataRequest
BUFFER_LENGTH_BYTE, BUFFER_LENGTH_DOUBLE, BUFFER_LENGTH_FLOAT, BUFFER_LENGTH_INT, BUFFER_LENGTH_LONG, BUFFER_LENGTH_SHORT, dataBuffer, MAX_OFFSET_VALUE, MIN_OFFSET_VALUE, offset, type -
Constructor Summary
Constructors Constructor Description FloatRequest()Creates a new float data request.FloatRequest(int offset)Creates a new float data request associated with given offset.FloatRequest(int offset, float value)Creates a new float data request associated with given offset and with given value.This also sets data request type to WRITE.FloatRequest(int offset, java.lang.Float value)Creates a new float data request associated with given offset and with given value.This also sets data request type to WRITE. -
Method Summary
Methods inherited from class com.mouseviator.fsuipc.datarequest.DataRequest
convertStringToByteArray, copyByteArray, getDataBuffer, getDouble, getFloat, getInt, getLong, getOffset, getShort, getSize, getType, getZeroTerminatedString, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putLong, putLong, putShort, putShort, setOffset, setTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mouseviator.fsuipc.datarequest.IDataRequest
getDataBuffer, getOffset, getSize, getType, setOffset, setType
-
Constructor Details
-
FloatRequest
public FloatRequest()Creates a new float data request. -
FloatRequest
public FloatRequest(int offset) throws java.security.InvalidParameterExceptionCreates a new float data request associated with given offset.- Parameters:
offset- An offset to associate this data request with.- Throws:
java.security.InvalidParameterException
-
FloatRequest
public FloatRequest(int offset, float value) throws java.security.InvalidParameterExceptionCreates a new float data request associated with given offset and with given value.This also sets data request type to WRITE.- Parameters:
offset- An offset to associate this data request with.value- The actual value.- Throws:
java.security.InvalidParameterException
-
FloatRequest
public FloatRequest(int offset, java.lang.Float value) throws java.security.InvalidParameterExceptionCreates a new float data request associated with given offset and with given value.This also sets data request type to WRITE.- Parameters:
offset- An offset to associate this data request with.value- The actual value.- Throws:
java.security.InvalidParameterException
-
-
Method Details
-
getValue
public java.lang.Float getValue()Description copied from interface:IDataRequestReturns the value stored within this data request byte data buffer.- Specified by:
getValuein interfaceIDataRequest<java.lang.Float>- Returns:
- The value stored within this data request.
-
setValue
public void setValue(java.lang.Float value)Description copied from interface:IDataRequestSets the value to be stored in the byte data buffer of this data request.- Specified by:
setValuein interfaceIDataRequest<java.lang.Float>- Parameters:
value- The value to store.
-