Package org.epics.pvdata.pv
Interface PVUnion
-
- All Superinterfaces:
PVField,Serializable
- All Known Implementing Classes:
BasePVUnion
public interface PVUnion extends PVField, Serializable
PVUnion interface.- Author:
- mse
-
-
Field Summary
Fields Modifier and Type Field Description static intUNDEFINED_INDEXUndefined index.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PVFieldget()Get thePVFieldvalue stored in the field.<T extends PVField>
Tget(Class<T> c)Get thePVFieldvalue stored in the field.StringgetSelectedFieldName()Get selected field name.intgetSelectedIndex()Get selected field index.UniongetUnion()Get the union introspection interface.PVFieldselect(int index)Select field (set index) and get the field at the index.<T extends PVField>
Tselect(Class<T> c, int index)Select field (set index) and get the field at the index.<T extends PVField>
Tselect(Class<T> c, String fieldName)Select field (set index) and get the field by given name.PVFieldselect(String fieldName)Select field (set index) and get the field by given name.voidset(int index, PVField value)Set thePVField(by reference!) as field at given index.voidset(String fieldName, PVField value)Set thePVField(by reference!) as field by given name.voidset(PVField value)Set thePVField(by reference!) as selected field.-
Methods inherited from interface org.epics.pvdata.pv.PVField
getField, getFieldName, getFieldOffset, getFullName, getNextFieldOffset, getNumberFields, getParent, isImmutable, postPut, setImmutable, setPostHandler, toString, toString, toString
-
Methods inherited from interface org.epics.pvdata.pv.Serializable
deserialize, serialize
-
-
-
-
Field Detail
-
UNDEFINED_INDEX
static final int UNDEFINED_INDEX
Undefined index. Default value upon PVUnion construction. Can be set by the user. Corresponds tonullvalue.- See Also:
- Constant Field Values
-
-
Method Detail
-
getUnion
Union getUnion()
Get the union introspection interface.- Returns:
- The introspection interface.
-
get
PVField get()
Get thePVFieldvalue stored in the field.- Returns:
PVFieldvalue of field,nullifgetSelectedIndex() == UNDEFINED_INDEX
-
get
<T extends PVField> T get(Class<T> c)
Get thePVFieldvalue 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:
PVFieldvalue of field,nullifgetSelectedIndex() == 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),
nullifindex == 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 fieldindex- index of the field to select.- Returns:
- corresponding PVField (of undetermined value),
nullifindex == 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 fieldfieldName- 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 thePVField(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 thePVField(by reference!) as field at given index. If a value is not a valid union field anIllegalArgumentExceptionexception is thrown. Useselect(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 thePVField(by reference!) as field by given name. If a value is not a valid union field anIllegalArgumentExceptionexception is thrown. Useselect(String)to put by value.- Parameters:
fieldName- Name of the field to putvalue- the field to set- See Also:
select(String)
-
-