Package org.epics.pvdata.factory
Class AbstractPVField
- java.lang.Object
-
- org.epics.pvdata.factory.AbstractPVField
-
- All Implemented Interfaces:
PVField,Serializable
- Direct Known Subclasses:
AbstractPVArray,AbstractPVScalar,BasePVStructure,BasePVUnion
public abstract class AbstractPVField extends Object implements PVField
Abstract base class for a PVField. A factory that implements PVField must extend this class.- Author:
- mrk
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPVField(Field field)Constructor that must be called by derived classes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidchangeField(Field field)FieldgetField()Get the Field that describes the field.StringgetFieldName()Get the fieldName for this field.intgetFieldOffset()Get offset of the PVField field within top level structure.StringgetFullName()Fully expand the name of this field using the names of its parent fields with a period '.' separating each name.intgetNextFieldOffset()Get the next offset.intgetNumberFields()Get the total number of fields in this field.PVStructuregetParent()Get the parent of this field.booleanisImmutable()Is the field immutable - that is, does it not allow changes?voidpostPut()postPut - called when the field is updated by the implementation.protected voidsetData(Field field, PVStructure parent, String fieldName)voidsetImmutable()Set the field to be immutable - that is, it can no longer be modified.voidsetPostHandler(PostHandler postHandler)Set the handler for postPut.StringtoString()Implement standard toString().voidtoString(StringBuilder buf)Convert the PVField to a string.voidtoString(StringBuilder buf, int indentLevel)Convert the PVField to a string, indenting each line.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.epics.pvdata.pv.Serializable
deserialize, serialize
-
-
-
-
Field Detail
-
convert
protected static final Convert convert
Convenience method for derived classes that perform conversions.
-
-
Constructor Detail
-
AbstractPVField
protected AbstractPVField(Field field)
Constructor that must be called by derived classes.- Parameters:
field- The introspection interface.- Throws:
IllegalArgumentException- if field is null;
-
-
Method Detail
-
setData
protected void setData(Field field, PVStructure parent, String fieldName)
-
changeField
protected void changeField(Field field)
-
getFieldName
public String getFieldName()
Description copied from interface:PVFieldGet the fieldName for this field.- Specified by:
getFieldNamein interfacePVField- Returns:
- the name or the empty string if top-level field.
-
getFullName
public String getFullName()
Description copied from interface:PVFieldFully expand the name of this field using the names of its parent fields with a period '.' separating each name.- Specified by:
getFullNamein interfacePVField- Returns:
- the full name or the empty string if top-level field
-
postPut
public void postPut()
Description copied from interface:PVFieldpostPut - called when the field is updated by the implementation.
-
setPostHandler
public void setPostHandler(PostHandler postHandler)
Description copied from interface:PVFieldSet the handler for postPut. At most one handler can be set.- Specified by:
setPostHandlerin interfacePVField- Parameters:
postHandler- the handler
-
getFieldOffset
public int getFieldOffset()
Description copied from interface:PVFieldGet offset of the PVField field within top level structure. Every field within the PVStructure has a unique offset. The top level structure has an offset of 0. The first field within the structure has offset equal to 1. The other offsets are determined by recursively traversing each structure of the tree.- Specified by:
getFieldOffsetin interfacePVField- Returns:
- the offset
-
getNextFieldOffset
public int getNextFieldOffset()
Description copied from interface:PVFieldGet the next offset. If the field is a scalar or array field then this is just offset + 1. If the field is a structure it is the offset of the next field after this structure. Thus (nextOffset - offset) is always equal to the number of fields within the field.- Specified by:
getNextFieldOffsetin interfacePVField- Returns:
- the offset.
-
getNumberFields
public int getNumberFields()
Description copied from interface:PVFieldGet the total number of fields in this field. This is equal to nextFieldOffset - fieldOffset.- Specified by:
getNumberFieldsin interfacePVField- Returns:
- the number of fields
-
isImmutable
public boolean isImmutable()
Description copied from interface:PVFieldIs the field immutable - that is, does it not allow changes?- Specified by:
isImmutablein interfacePVField- Returns:
- (false,true) if it (is not, is) immutable
-
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
-
getField
public Field getField()
Description copied from interface:PVFieldGet the Field that describes the field.
-
getParent
public PVStructure getParent()
Description copied from interface:PVFieldGet the parent of this field.
-
toString
public void toString(StringBuilder buf)
Description copied from interface:PVFieldConvert the PVField to a string.
-
toString
public void toString(StringBuilder buf, int indentLevel)
Description copied from interface:PVFieldConvert the PVField to a string, indenting each line.
-
-