Class BasePVUnion

    • Constructor Detail

      • BasePVUnion

        public BasePVUnion​(Union union)
        Constructor.
        Parameters:
        union - the reflection interface for the PVUnion data.
    • Method Detail

      • getUnion

        public Union getUnion()
        Description copied from interface: PVUnion
        Get the union introspection interface.
        Specified by:
        getUnion in interface PVUnion
        Returns:
        The introspection interface.
      • get

        public PVField get()
        Description copied from interface: PVUnion
        Get the PVField value stored in the field.
        Specified by:
        get in interface PVUnion
        Returns:
        PVField value of field, null if getSelectedIndex() == UNDEFINED_INDEX
      • get

        public <T extends PVField> T get​(Class<T> c)
        Description copied from interface: PVUnion
        Get the PVField value stored in the field.
        Specified by:
        get in interface PVUnion
        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
        Returns:
        PVField value of field, null if getSelectedIndex() == UNDEFINED_INDEX
      • getSelectedIndex

        public int getSelectedIndex()
        Description copied from interface: PVUnion
        Get selected field index.
        Specified by:
        getSelectedIndex in interface PVUnion
        Returns:
        selected field index
      • getSelectedFieldName

        public String getSelectedFieldName()
        Description copied from interface: PVUnion
        Get selected field name.
        Specified by:
        getSelectedFieldName in interface PVUnion
        Returns:
        selected field name
      • select

        public PVField select​(int index)
        Description copied from interface: PVUnion
        Select field (set index) and get the field at the index.
        Specified by:
        select in interface PVUnion
        Parameters:
        index - index of the field to select
        Returns:
        corresponding PVField (of undetermined value), null if index == UNDEFINED_INDEX
      • select

        public PVField select​(String fieldName)
        Description copied from interface: PVUnion
        Select field (set index) and get the field by given name.
        Specified by:
        select in interface PVUnion
        Parameters:
        fieldName - the name of the field to select.
        Returns:
        corresponding PVField (of undetermined value).
      • select

        public <T extends PVField> T select​(Class<T> c,
                                            int index)
        Description copied from interface: PVUnion
        Select field (set index) and get the field at the index.
        Specified by:
        select in interface PVUnion
        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
        index - index of the field to select.
        Returns:
        corresponding PVField (of undetermined value), null if index == UNDEFINED_INDEX
      • select

        public <T extends PVField> T select​(Class<T> c,
                                            String fieldName)
        Description copied from interface: PVUnion
        Select field (set index) and get the field by given name.
        Specified by:
        select in interface PVUnion
        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 name of the field to select
        Returns:
        corresponding PVField (of undetermined value)
      • set

        public void set​(PVField value)
        Description copied from interface: PVUnion
        Set the PVField (by reference!) as selected field.
        Specified by:
        set in interface PVUnion
        Parameters:
        value - the field to set
      • set

        public void set​(int index,
                        PVField value)
        Description copied from interface: PVUnion
        Set the PVField (by reference!) as field at given index. If a value is not a valid union field an IllegalArgumentException exception is thrown. Use select(int) to put by value.
        Specified by:
        set in interface PVUnion
        Parameters:
        index - index of a field to put.
        value - the field to set.
        See Also:
        PVUnion.select(int)
      • set

        public void set​(String fieldName,
                        PVField value)
        Description copied from interface: PVUnion
        Set the PVField (by reference!) as field by given name. If a value is not a valid union field an IllegalArgumentException exception is thrown. Use select(String) to put by value.
        Specified by:
        set in interface PVUnion
        Parameters:
        fieldName - Name of the field to put
        value - the field to set
        See Also:
        PVUnion.select(String)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object