Interface PVUnion

    • Field Detail

      • UNDEFINED_INDEX

        static final int UNDEFINED_INDEX
        Undefined index. Default value upon PVUnion construction. Can be set by the user. Corresponds to null value.
        See Also:
        Constant Field Values
    • Method Detail

      • getUnion

        Union getUnion()
        Get the union introspection interface.
        Returns:
        The introspection interface.
      • get

        PVField get()
        Get the PVField value stored in the field.
        Returns:
        PVField value of field, null if getSelectedIndex() == UNDEFINED_INDEX
      • get

        <T extends PVField> T get​(Class<T> c)
        Get the PVField value stored in the field.
        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
      • select

        PVField select​(int index)
        Select field (set index) and get the field at the index.
        Parameters:
        index - index of the field to select
        Returns:
        corresponding PVField (of undetermined value), null if index == UNDEFINED_INDEX
        Throws:
        IllegalArgumentException - if index is invalid (out of range)
      • select

        <T extends PVField> T select​(Class<T> c,
                                     int index)
        Select field (set index) and get the field at the index.
        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
        Throws:
        IllegalArgumentException - if index is invalid (out of range)
      • select

        PVField select​(String fieldName)
        Select field (set index) and get the field by given name.
        Parameters:
        fieldName - the name of the field to select.
        Returns:
        corresponding PVField (of undetermined value).
        Throws:
        IllegalArgumentException - if field does not exist.
      • select

        <T extends PVField> T select​(Class<T> c,
                                     String fieldName)
        Select field (set index) and get the field by given name.
        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)
        Throws:
        IllegalArgumentException - if field does not exist
      • getSelectedIndex

        int getSelectedIndex()
        Get selected field index.
        Returns:
        selected field index
      • getSelectedFieldName

        String getSelectedFieldName()
        Get selected field name.
        Returns:
        selected field name
      • set

        void set​(PVField value)
        Set the PVField (by reference!) as selected field.
        Parameters:
        value - the field to set
        Throws:
        IllegalArgumentException - if value is not a valid union field
      • set

        void set​(int index,
                 PVField value)
        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.
        Parameters:
        index - index of a field to put.
        value - the field to set.
        See Also:
        select(int)
      • set

        void set​(String fieldName,
                 PVField value)
        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.
        Parameters:
        fieldName - Name of the field to put
        value - the field to set
        See Also:
        select(String)