public class BaseStructure extends BaseField implements Structure
DEFAULT_ID
Constructor and Description |
---|
BaseStructure(String[] fieldNames,
Field[] fields)
Constructor for a structure field.
|
BaseStructure(String id,
String[] fieldNames,
Field[] fields)
Constructor for a structure field.
|
Modifier and Type | Method and Description |
---|---|
void |
deserialize(ByteBuffer buffer,
DeserializableControl control)
Deserialize buffer.
|
boolean |
equals(Object obj) |
Field |
getField(int fieldIndex)
Get a sub fields by index.
|
Field |
getField(String name)
Get the Field for the specified fieldName
|
int |
getFieldIndex(String name)
Get the index of the specified field.
|
String |
getFieldName(int fieldIndex)
Get the name of the subfield by index.
|
String[] |
getFieldNames()
Get the array of the subfield names.
|
Field[] |
getFields()
Get all the subfields of the structure.
|
String |
getID()
Get the identification string.
|
int |
hashCode() |
void |
serialize(ByteBuffer buffer,
SerializableControl control)
Serialize field into given buffer.
|
void |
toString(StringBuilder buf,
int indentLevel)
Convert to a string
|
public BaseStructure(String[] fieldNames, Field[] fields)
fieldNames
- The field names for the subfieldsfields
- The array of nodes definitions for the nodes of the structure.public BaseStructure(String id, String[] fieldNames, Field[] fields)
id
- The identification string for the structure.fieldNames
- The field names for the subfieldsfields
- The array of nodes definitions for the nodes of the structure.IllegalArgumentException
- if id is null or empty.public Field getField(String name)
Structure
public int getFieldIndex(String name)
Structure
getFieldIndex
in interface Structure
name
- The name of the field.public Field getField(int fieldIndex)
Structure
public String[] getFieldNames()
Structure
getFieldNames
in interface Structure
public String getFieldName(int fieldIndex)
Structure
getFieldName
in interface Structure
fieldIndex
- The field index.public Field[] getFields()
Structure
public void toString(StringBuilder buf, int indentLevel)
Field
public void serialize(ByteBuffer buffer, SerializableControl control)
Serializable
serialize
in interface Serializable
buffer
- serialization buffer.control
- flush interface.public void deserialize(ByteBuffer buffer, DeserializableControl control)
Serializable
deserialize
in interface Serializable
buffer
- serialization buffer.control
- deserialization control.Copyright © 2014. All Rights Reserved.