Class BasePVStructure

    • Constructor Detail

      • BasePVStructure

        public BasePVStructure​(Structure structure)
        Constructor.
        Parameters:
        structure - the reflection interface for the PVStructure data.
      • BasePVStructure

        public BasePVStructure​(Structure structure,
                               PVField[] pvFields)
        Constructor.
        Parameters:
        structure - the reflection interface for the PVStructure data.
        pvFields - The PVField array for the subfields.
    • Method Detail

      • setImmutable

        public void setImmutable()
        Description copied from interface: PVField
        Set 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:
        setImmutable in interface PVField
        Overrides:
        setImmutable in class AbstractPVField
      • getSubField

        public PVField getSubField​(String fieldName)
        Description copied from interface: PVStructure
        Get 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:
        getSubField in interface PVStructure
        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: PVStructure
        Get the PVField with the specified offset.
        Specified by:
        getSubField in interface PVStructure
        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: PVStructure
        Get the Structure introspection interface.
        Specified by:
        getStructure in interface PVStructure
        Returns:
        the introspection interface
      • getPVFields

        public PVField[] getPVFields()
        Description copied from interface: PVStructure
        Get the PVField array for the nodes of the structure.
        Specified by:
        getPVFields in interface PVStructure
        Returns:
        array of PVField, one for each field
      • getBooleanField

        public PVBoolean getBooleanField​(String fieldName)
        Description copied from interface: PVStructure
        Find a boolean subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getBooleanField in interface PVStructure
        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: PVStructure
        Find a byte subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getByteField in interface PVStructure
        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: PVStructure
        Find a short subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getShortField in interface PVStructure
        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: PVStructure
        Find an int subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getIntField in interface PVStructure
        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: PVStructure
        Get 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:
        getSubField in interface PVStructure
        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 field
        fieldName - 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: PVStructure
        Get the PVField with the specified offset.
        Specified by:
        getSubField in interface PVStructure
        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 field
        fieldOffset - 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: PVStructure
        Find a long subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getLongField in interface PVStructure
        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: PVStructure
        Find a float subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getFloatField in interface PVStructure
        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: PVStructure
        Find a double subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getDoubleField in interface PVStructure
        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: PVStructure
        Find a string subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getStringField in interface PVStructure
        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: PVStructure
        Find a structure subfield with the specified fieldName

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getStructureField in interface PVStructure
        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: PVStructure
        Find a union subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getUnionField in interface PVStructure
        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: PVStructure
        Find an array subfield with the specified fieldName and elementType.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getScalarArrayField in interface PVStructure
        Parameters:
        fieldName - the name of the field to find
        elementType - 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: PVStructure
        Find a structureArray subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getStructureArrayField in interface PVStructure
        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: PVStructure
        Find a unionArray subfield with the specified fieldName.

        fieldName is the full name of the field relative to this PVStructure.

        Specified by:
        getUnionArrayField in interface PVStructure
        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: PVStructure
        Check if PVStructure and sub fields are valid.
        Specified by:
        checkValid in interface PVStructure
        Returns:
        (true,false) if (OK, problems found)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object