Class BasePVStructure
- java.lang.Object
-
- org.epics.pvdata.factory.AbstractPVField
-
- org.epics.pvdata.factory.BasePVStructure
-
- All Implemented Interfaces:
BitSetSerializable,PVField,PVStructure,Serializable
public class BasePVStructure extends AbstractPVField implements PVStructure
Base class for a PVStructure.- Author:
- mrk
-
-
Field Summary
-
Fields inherited from class org.epics.pvdata.factory.AbstractPVField
convert
-
-
Constructor Summary
Constructors Constructor Description BasePVStructure(Structure structure)Constructor.BasePVStructure(Structure structure, PVField[] pvFields)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckValid()Check if PVStructure and sub fields are valid.voiddeserialize(ByteBuffer buffer, DeserializableControl control)Deserialize buffer.voiddeserialize(ByteBuffer buffer, DeserializableControl control, BitSet bitSet)Deserialize buffer.booleanequals(Object obj)PVBooleangetBooleanField(String fieldName)Find a boolean subfield with the specified fieldName.PVBytegetByteField(String fieldName)Find a byte subfield with the specified fieldName.PVDoublegetDoubleField(String fieldName)Find a double subfield with the specified fieldName.PVFloatgetFloatField(String fieldName)Find a float subfield with the specified fieldName.PVIntgetIntField(String fieldName)Find an int subfield with the specified fieldName.PVLonggetLongField(String fieldName)Find a long subfield with the specified fieldName.PVField[]getPVFields()Get the PVField array for the nodes of the structure.PVScalarArraygetScalarArrayField(String fieldName, ScalarType elementType)Find an array subfield with the specified fieldName and elementType.PVShortgetShortField(String fieldName)Find a short subfield with the specified fieldName.PVStringgetStringField(String fieldName)Find a string subfield with the specified fieldName.StructuregetStructure()Get the Structure introspection interface.PVStructureArraygetStructureArrayField(String fieldName)Find a structureArray subfield with the specified fieldName.PVStructuregetStructureField(String fieldName)Find a structure subfield with the specified fieldNamePVFieldgetSubField(int fieldOffset)Get the PVField with the specified offset.<T extends PVField>
TgetSubField(Class<T> c, int fieldOffset)Get the PVField with the specified offset.<T extends PVField>
TgetSubField(Class<T> c, String fieldName)Get the PVField subfield with name fieldName.PVFieldgetSubField(String fieldName)Get the PVField subfield with name fieldName.PVUnionArraygetUnionArrayField(String fieldName)Find a unionArray subfield with the specified fieldName.PVUniongetUnionField(String fieldName)Find a union subfield with the specified fieldName.inthashCode()voidserialize(ByteBuffer buffer, SerializableControl flusher)Serialize field into given buffer.voidserialize(ByteBuffer buffer, SerializableControl flusher, BitSet bitSet)Serialize field into the given buffer.voidsetImmutable()Set the field to be immutable - that is, it can no longer be modified.-
Methods inherited from class org.epics.pvdata.factory.AbstractPVField
changeField, getField, getFieldName, getFieldOffset, getFullName, getNextFieldOffset, getNumberFields, getParent, isImmutable, postPut, setData, setPostHandler, toString, toString, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.epics.pvdata.pv.PVField
getField, getFieldName, getFieldOffset, getFullName, getNextFieldOffset, getNumberFields, getParent, isImmutable, postPut, setPostHandler, toString, toString, toString
-
-
-
-
Constructor Detail
-
BasePVStructure
public BasePVStructure(Structure structure)
Constructor.- Parameters:
structure- the reflection interface for the PVStructure data.
-
-
Method Detail
-
setImmutable
public void setImmutable()
Description copied from interface:PVFieldSet the field to be immutable - that is, it can no longer be modified. This is permanent. Once done the field cannot be made mutable.- Specified by:
setImmutablein interfacePVField- Overrides:
setImmutablein classAbstractPVField
-
getSubField
public PVField getSubField(String fieldName)
Description copied from interface:PVStructureGet the PVField subfield with name fieldName.fieldName is the name of the field relative to this PVStructure. So it consists of one or more strings separated by periods (.s). The last of these strings is the name of the field. The other strings are the names of the structure subfields containing the requested field starting with the highest-level subfield and descending to the leaf field, e.g. current.alarm.status.
- Specified by:
getSubFieldin interfacePVStructure- Parameters:
fieldName- the fieldName- Returns:
- the PVField or null if the subfield does not exist
-
getSubField
public PVField getSubField(int fieldOffset)
Description copied from interface:PVStructureGet the PVField with the specified offset.- Specified by:
getSubFieldin interfacePVStructure- Parameters:
fieldOffset- the offset- Returns:
- the PVField or null if the offset is not part of this structure
-
getStructure
public Structure getStructure()
Description copied from interface:PVStructureGet the Structure introspection interface.- Specified by:
getStructurein interfacePVStructure- Returns:
- the introspection interface
-
getPVFields
public PVField[] getPVFields()
Description copied from interface:PVStructureGet the PVField array for the nodes of the structure.- Specified by:
getPVFieldsin interfacePVStructure- Returns:
- array of PVField, one for each field
-
getBooleanField
public PVBoolean getBooleanField(String fieldName)
Description copied from interface:PVStructureFind a boolean subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getBooleanFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to find- Returns:
- the interface if the field of the correct type is found or null otherwise
-
getByteField
public PVByte getByteField(String fieldName)
Description copied from interface:PVStructureFind a byte subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getByteFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to find- Returns:
- the interface if the field of the correct type is found or null if not found
-
getShortField
public PVShort getShortField(String fieldName)
Description copied from interface:PVStructureFind a short subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getShortFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to find.- Returns:
- the interface if the field of the correct type is found or null otherwise
-
getIntField
public PVInt getIntField(String fieldName)
Description copied from interface:PVStructureFind an int subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getIntFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to find- Returns:
- the interface if the field of the correct type is found or null if not found
-
getSubField
public <T extends PVField> T getSubField(Class<T> c, String fieldName)
Description copied from interface:PVStructureGet the PVField subfield with name fieldName.fieldName is the name of the field relative to this PVStructure. So it consists of one or more strings separated by periods (.s). The last of these strings is the name of the field. The other strings are the names of the structure subfields containing the requested field starting with the highest-level subfield and descending to the leaf field, e.g. current.alarm.status.
- Specified by:
getSubFieldin interfacePVStructure- Type Parameters:
T- the expected type of the PVField of the requested field- Parameters:
c- class object modeling the class T of expected type of the requested fieldfieldName- the fieldName.- Returns:
- the PVField or null if the subfield does not exist, or the field is not of type
T
-
getSubField
public <T extends PVField> T getSubField(Class<T> c, int fieldOffset)
Description copied from interface:PVStructureGet the PVField with the specified offset.- Specified by:
getSubFieldin interfacePVStructure- Type Parameters:
T- the expected type of the PVField of the requested field- Parameters:
c- class object modeling the class T of expected type of the requested fieldfieldOffset- the offset- Returns:
- the PVField or null if the offset is not part of this structure, or the field is not of type
T
-
getLongField
public PVLong getLongField(String fieldName)
Description copied from interface:PVStructureFind a long subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getLongFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to find.- Returns:
- the interface if the field of the correct type is found or null otherwise
-
getFloatField
public PVFloat getFloatField(String fieldName)
Description copied from interface:PVStructureFind a float subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getFloatFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to find- Returns:
- the interface if the field of the correct type is found or null otherwise
-
getDoubleField
public PVDouble getDoubleField(String fieldName)
Description copied from interface:PVStructureFind a double subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getDoubleFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to find- Returns:
- the interface if the field of the correct type is found or null otherwise
-
getStringField
public PVString getStringField(String fieldName)
Description copied from interface:PVStructureFind a string subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getStringFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to find- Returns:
- the interface if the field of the correct type is found or null otherwise
-
getStructureField
public PVStructure getStructureField(String fieldName)
Description copied from interface:PVStructureFind a structure subfield with the specified fieldNamefieldName is the full name of the field relative to this PVStructure.
- Specified by:
getStructureFieldin interfacePVStructure- Parameters:
fieldName- The field name to find.- Returns:
- the interface if the field of the correct type is found or null otherwise
-
getUnionField
public PVUnion getUnionField(String fieldName)
Description copied from interface:PVStructureFind a union subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getUnionFieldin interfacePVStructure- Parameters:
fieldName- the field name to find- Returns:
- the interface if the field of the correct type is found or null otherwise
-
getScalarArrayField
public PVScalarArray getScalarArrayField(String fieldName, ScalarType elementType)
Description copied from interface:PVStructureFind an array subfield with the specified fieldName and elementType.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getScalarArrayFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to findelementType- the ScalarType of an element of the ScalarArray field- Returns:
- the interface if the field of the correct type is found or null otherwise
-
getStructureArrayField
public PVStructureArray getStructureArrayField(String fieldName)
Description copied from interface:PVStructureFind a structureArray subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getStructureArrayFieldin interfacePVStructure- Parameters:
fieldName- the name of the field to find- Returns:
- the interface if the field of the correct type is found or null if not found
-
getUnionArrayField
public PVUnionArray getUnionArrayField(String fieldName)
Description copied from interface:PVStructureFind a unionArray subfield with the specified fieldName.fieldName is the full name of the field relative to this PVStructure.
- Specified by:
getUnionArrayFieldin interfacePVStructure- Parameters:
fieldName- The field name to find- Returns:
- the interface if the field of the correct type is found or null otherwise
-
checkValid
public boolean checkValid()
Description copied from interface:PVStructureCheck if PVStructure and sub fields are valid.- Specified by:
checkValidin interfacePVStructure- Returns:
- (true,false) if (OK, problems found)
-
serialize
public void serialize(ByteBuffer buffer, SerializableControl flusher)
Description copied from interface:SerializableSerialize field into given buffer.- Specified by:
serializein interfaceSerializable- Parameters:
buffer- the serialization bufferflusher- the flush interface
-
deserialize
public void deserialize(ByteBuffer buffer, DeserializableControl control)
Description copied from interface:SerializableDeserialize buffer.- Specified by:
deserializein interfaceSerializable- Parameters:
buffer- the serialization buffercontrol- the deserialization control
-
deserialize
public void deserialize(ByteBuffer buffer, DeserializableControl control, BitSet bitSet)
Description copied from interface:BitSetSerializableDeserialize buffer.- Specified by:
deserializein interfaceBitSetSerializable- Parameters:
buffer- serialization buffercontrol- deserialization control instancebitSet- the BitSet which shows the fields to deserialize
-
serialize
public void serialize(ByteBuffer buffer, SerializableControl flusher, BitSet bitSet)
Description copied from interface:BitSetSerializableSerialize field into the given buffer.- Specified by:
serializein interfaceBitSetSerializable- Parameters:
buffer- serialization bufferflusher- flush interfacebitSet- the BitSet which shows the fields to serialize
-
-