com.neeve.sto
Class StoCompoundArrayField

java.lang.Object
  extended by com.neeve.util.UtlListElement
      extended by com.neeve.sto.StoField
          extended by com.neeve.sto.StoVariableLengthField<StoFieldContainer[]>
              extended by com.neeve.sto.StoCompoundArrayField
All Implemented Interfaces:
Cloneable

public final class StoCompoundArrayField
extends StoVariableLengthField<StoFieldContainer[]>

An STO field that holds an array of compound values.

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 StoCompoundArrayField create(ByteBuffer buffer, int bufferOffset)
          Create an STO compound array field from its serialized form.
static StoCompoundArrayField create(String name)
          Create an STO compound array field.
static StoFieldContainer[] get(ByteBuffer buffer, int offset)
          Deserialize a compound array.
static int getSerializedLength(ByteBuffer buffer, int offset)
          Get the length of a serialized compound array.
static int getSerializedLength(StoFieldContainer[] val)
          Get the serialized length of a compound array.
static int put(ByteBuffer buffer, int offset, StoFieldContainer[] val)
          Serialize a compound array.
 
Methods inherited from class com.neeve.sto.StoVariableLengthField
getValue, isVariableLength, reset, setValue
 
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 StoCompoundArrayField create(String name)
Create an STO compound array field.

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

create

public static StoCompoundArrayField create(ByteBuffer buffer,
                                           int bufferOffset)
Create an STO compound array field from its serialized form.

Parameters:
buffer - The buffer to deserialize the field from.
bufferOffset - The offset into the supplied buffer from where to deserialize the field.

getSerializedLength

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

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

This method leaves the buffer markers intact.


getSerializedLength

public static int getSerializedLength(StoFieldContainer[] val)
Get the serialized length of a compound array.

Parameters:
val - The compound array whose serialized length is to be returned.

put

public static int put(ByteBuffer buffer,
                      int offset,
                      StoFieldContainer[] val)
Serialize a compound array.

Parameters:
buffer - The buffer in which to serialize the array.
offset - The offset into the buffer at which point to serialize the array.
Returns:
Returns the serialized length

This method leaves the buffer markers intact.


get

public static StoFieldContainer[] get(ByteBuffer buffer,
                                      int offset)
Deserialize a compound array.

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

This method leaves the buffer markers intact.



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