public class BasePVStructure extends AbstractPVField implements PVStructure
convert
Constructor and Description |
---|
BasePVStructure(Structure structure)
Constructor.
|
BasePVStructure(Structure structure,
PVField[] pvFields)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
appendPVField(String fieldName,
PVField pvField)
Append a new PVField to this structure.
|
void |
appendPVFields(String[] fieldNames,
PVField[] extraPVFields)
Append a PVField[].
|
boolean |
checkValid()
Check if PVStructure and sub fields are valid.
|
void |
deserialize(ByteBuffer buffer,
DeserializableControl control)
Deserialize buffer.
|
void |
deserialize(ByteBuffer buffer,
DeserializableControl control,
BitSet bitSet)
Deserialize buffer.
|
boolean |
equals(Object obj) |
PVBoolean |
getBooleanField(String fieldName)
Find a boolean subfield with the specified fieldName.
|
PVByte |
getByteField(String fieldName)
Find a byte subfield with the specified fieldName.
|
PVDouble |
getDoubleField(String fieldName)
Find a double subfield with the specified fieldName.
|
String |
getExtendsStructureName()
Get the name of structure that this structure extends.
|
PVFloat |
getFloatField(String fieldName)
Find a float subfield with the specified fieldName.
|
PVInt |
getIntField(String fieldName)
Find an int subfield with the specified fieldName.
|
PVLong |
getLongField(String fieldName)
Find a long subfield with the specified fieldName.
|
PVField[] |
getPVFields()
Get the PVField array for the nodes of the structure.
|
PVScalarArray |
getScalarArrayField(String fieldName,
ScalarType elementType)
Find an array subfield with the specified fieldName and elementType.
|
PVShort |
getShortField(String fieldName)
Find a short subfield with the specified fieldName.
|
PVString |
getStringField(String fieldName)
Find a string subfield with the specified fieldName.
|
Structure |
getStructure()
Get the Structure introspection interface.
|
PVStructureArray |
getStructureArrayField(String fieldName)
Find a structureArray subfield with the specified fieldName.
|
PVStructure |
getStructureField(String fieldName)
Find a structure subfield with the specified fieldName
The fieldName is of the form name.name...
|
<T extends PVField> |
getSubField(Class<T> c,
int fieldOffset)
Get the PVField with the specified offset.
|
<T extends PVField> |
getSubField(Class<T> c,
String fieldName)
Get the PVField subfield with name fieldName.
|
PVField |
getSubField(int fieldOffset)
Get the PVField with the specified offset.
|
PVField |
getSubField(String fieldName)
Get the PVField subfield with name fieldName.
|
PVUnionArray |
getUnionArrayField(String fieldName)
Find a unionArray subfield with the specified fieldName.
|
PVUnion |
getUnionField(String fieldName)
Find a unon subfield with the specified fieldName.
|
int |
hashCode() |
boolean |
putExtendsStructureName(String extendsStructureName)
Specify the structure that this structure extends.
|
void |
removePVField(String fieldName)
Remove a field.
|
void |
replacePVField(PVField oldPVField,
PVField newPVField)
Replace a field with a new field.
|
void |
serialize(ByteBuffer buffer,
SerializableControl flusher)
Serialize field into given buffer.
|
void |
serialize(ByteBuffer buffer,
SerializableControl flusher,
BitSet bitSet)
Serialize field into given buffer.
|
void |
setImmutable()
Set the field to be immutable, i.
|
changeField, getField, getFieldName, getFieldOffset, getNextFieldOffset, getNumberFields, getParent, getPVAuxInfo, getRequesterName, isImmutable, message, postPut, renameField, setData, setPostHandler, setRequester, toString, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getField, getFieldName, getFieldOffset, getNextFieldOffset, getNumberFields, getParent, getPVAuxInfo, isImmutable, postPut, renameField, setPostHandler, setRequester, toString, toString, toString
getRequesterName, message
public BasePVStructure(Structure structure)
structure
- the reflection interface for the PVStructure data.public void setImmutable()
PVField
setImmutable
in interface PVField
setImmutable
in class AbstractPVField
public PVField getSubField(String fieldName)
PVStructure
getSubField
in interface PVStructure
fieldName
- The fieldName.public PVField getSubField(int fieldOffset)
PVStructure
getSubField
in interface PVStructure
fieldOffset
- The offset.public Structure getStructure()
PVStructure
getStructure
in interface PVStructure
public void appendPVField(String fieldName, PVField pvField)
PVStructure
appendPVField
in interface PVStructure
fieldName
- The name of the fueld to append,pvField
- The field to append.public void appendPVFields(String[] fieldNames, PVField[] extraPVFields)
PVStructure
appendPVFields
in interface PVStructure
fieldNames
- The names for the new fields.extraPVFields
- The fields to append.
Note that if the original number of fields is 0 than pvFields replaces the original.
Thus the caller must NOT reuse pvFields after calling this method.public void removePVField(String fieldName)
PVStructure
removePVField
in interface PVStructure
fieldName
- The name of the field to remove.public void replacePVField(PVField oldPVField, PVField newPVField)
PVStructure
replacePVField
in interface PVStructure
oldPVField
- The old field.newPVField
- The new field.public PVField[] getPVFields()
PVStructure
getPVFields
in interface PVStructure
public PVBoolean getBooleanField(String fieldName)
PVStructure
getBooleanField
in interface PVStructure
fieldName
- The field name to find.public PVByte getByteField(String fieldName)
PVStructure
getByteField
in interface PVStructure
fieldName
- The field name to find.public PVShort getShortField(String fieldName)
PVStructure
getShortField
in interface PVStructure
fieldName
- The field name to find.public PVInt getIntField(String fieldName)
PVStructure
getIntField
in interface PVStructure
fieldName
- The field name to find.public <T extends PVField> T getSubField(Class<T> c, String fieldName)
PVStructure
getSubField
in interface PVStructure
c
- expected class of a requested field.fieldName
- The fieldName.c
type.public <T extends PVField> T getSubField(Class<T> c, int fieldOffset)
PVStructure
getSubField
in interface PVStructure
c
- expected class of a requested field.fieldOffset
- The offset.c
type.public PVLong getLongField(String fieldName)
PVStructure
getLongField
in interface PVStructure
fieldName
- The field name to find.public PVFloat getFloatField(String fieldName)
PVStructure
getFloatField
in interface PVStructure
fieldName
- The field name to find.public PVDouble getDoubleField(String fieldName)
PVStructure
getDoubleField
in interface PVStructure
fieldName
- The field name to find.public PVString getStringField(String fieldName)
PVStructure
getStringField
in interface PVStructure
fieldName
- The field name to find.public PVStructure getStructureField(String fieldName)
PVStructure
getStructureField
in interface PVStructure
fieldName
- The field name to find.public PVUnion getUnionField(String fieldName)
PVStructure
getUnionField
in interface PVStructure
fieldName
- The field name to find.public PVScalarArray getScalarArrayField(String fieldName, ScalarType elementType)
PVStructure
getScalarArrayField
in interface PVStructure
fieldName
- The field name to find.public PVStructureArray getStructureArrayField(String fieldName)
PVStructure
getStructureArrayField
in interface PVStructure
fieldName
- The field name to find.public PVUnionArray getUnionArrayField(String fieldName)
PVStructure
getUnionArrayField
in interface PVStructure
fieldName
- The field name to find.public String getExtendsStructureName()
PVStructure
getExtendsStructureName
in interface PVStructure
public boolean putExtendsStructureName(String extendsStructureName)
PVStructure
putExtendsStructureName
in interface PVStructure
extendsStructureName
- The structure this structure extends.public boolean checkValid()
PVStructure
checkValid
in interface PVStructure
public void serialize(ByteBuffer buffer, SerializableControl flusher)
Serializable
serialize
in interface Serializable
buffer
- serialization buffer.flusher
- flush interface.public void deserialize(ByteBuffer buffer, DeserializableControl control)
Serializable
deserialize
in interface Serializable
buffer
- serialization buffer.control
- deserialization control.public void deserialize(ByteBuffer buffer, DeserializableControl control, BitSet bitSet)
BitSetSerializable
deserialize
in interface BitSetSerializable
buffer
- serialization buffer.control
- deserialization control instance.bitSet
- The BitSet which shows the fields to deserialize.public void serialize(ByteBuffer buffer, SerializableControl flusher, BitSet bitSet)
BitSetSerializable
serialize
in interface BitSetSerializable
buffer
- serialization bufferflusher
- flush interface.bitSet
- The BitSet which shows the fields to serialize.Copyright © 2014. All Rights Reserved.