com.neeve.sto
Class StoFloatField

java.lang.Object
  extended by com.neeve.util.UtlListElement
      extended by com.neeve.sto.StoField
          extended by com.neeve.sto.StoFloatField
All Implemented Interfaces:
Cloneable

public final class StoFloatField
extends StoField

An STO field that holds a float value.

Threading:
STO fields are not safe for concurrent access by multiple threads.

Nested Class Summary
 
Nested classes/interfaces inherited from class com.neeve.sto.StoField
StoField.Type
 
Field Summary
 
Fields inherited from class com.neeve.util.UtlListElement
count, head, next, prev
 
Method Summary
static StoFloatField create(ByteBuffer buffer, int bufferOffset)
          Create an STO float field from its serialized form.
static StoFloatField create(String name)
          Create an STO float field.
static float get(ByteBuffer buffer, int offset)
          Deserialize a float value.
static int getSerializedLength(ByteBuffer buffer, int offset)
          Get the length of a serialized float value.
 float getValue()
          Set the field value
 boolean isVariableLength()
          Implementation of StoField.isVariableLength()
static void put(ByteBuffer buffer, int offset, float val)
          Serialize a float value.
 void reset()
          Implementation of StoField.reset()
 void setValue(float val)
          Set the field value
 
Methods inherited from class com.neeve.sto.StoField
changeBackingBuffer, clearBackingBuffer, clone, contentsEquals, getBackingBuffer, getHeader, getLength, getName, getSerializedLength, getType, getVersion, isNamed, setBackingBuffer, shiftForHeader, sync, toString
 
Methods inherited from class com.neeve.util.UtlListElement
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static StoFloatField create(String name)
Create an STO float field.

Parameters:
name - The name of the field. A value of null will cause an unnamed field to be created.

create

public static StoFloatField create(ByteBuffer buffer,
                                   int bufferOffset)
Create an STO float field from its serialized form.

Parameters:
buffer - The buffer containing the serialized field.
bufferOffset - The offset into the buffer where the serialized form of the field begins.

getSerializedLength

public static int getSerializedLength(ByteBuffer buffer,
                                      int offset)
Get the length of a serialized float value.

Parameters:
buffer - The buffer containing the serialized value.
offset - The offset into the buffer where the value is serialized.

This method leaves the buffer markers intact.


put

public static void put(ByteBuffer buffer,
                       int offset,
                       float val)
Serialize a float value.

Parameters:
buffer - The buffer in which to serialize the value.
offset - The offset into the buffer at which point to serialize the value.

This method leaves the buffer markers intact.


get

public static float get(ByteBuffer buffer,
                        int offset)
Deserialize a float value.

Parameters:
buffer - The buffer from which to deserialize the value.
offset - The offset into the buffer from which to deserialize the value.

This method leaves the buffer markers intact.


isVariableLength

public final boolean isVariableLength()
Implementation of StoField.isVariableLength()

Specified by:
isVariableLength in class StoField

reset

public final void reset()
Implementation of StoField.reset()

Specified by:
reset in class StoField

setValue

public final void setValue(float val)
Set the field value

Parameters:
val - The value to set.

getValue

public final float getValue()
Set the field value



Copyright © 2015 Neeve Research, LLC. All Rights Reserved.