public class BasePVUnion extends AbstractPVField implements PVUnion
convert
UNDEFINED_INDEX
Constructor and Description |
---|
BasePVUnion(Union union)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
deserialize(ByteBuffer buffer,
DeserializableControl control)
Deserialize buffer.
|
boolean |
equals(Object obj) |
PVField |
get()
Get the
PVField value stored in the field. |
<T extends PVField> |
get(Class<T> c)
Get the
PVField value stored in the field. |
String |
getSelectedFieldName()
Get selected field name.
|
int |
getSelectedIndex()
Get selected field index.
|
Union |
getUnion()
Get the union introspection interface.
|
int |
hashCode() |
<T extends PVField> |
select(Class<T> c,
int index)
Select field (set index) and get the field at the index.
|
<T extends PVField> |
select(Class<T> c,
String fieldName)
Select field (set index) and get the field by given name.
|
PVField |
select(int index)
Select field (set index) and get the field at the index.
|
PVField |
select(String fieldName)
Select field (set index) and get the field by given name.
|
void |
serialize(ByteBuffer buffer,
SerializableControl flusher)
Serialize field into given buffer.
|
void |
set(int index,
PVField value)
Set the
PVField (by reference!) as field at given index. |
void |
set(PVField value)
Set the
PVField (by reference!) as selected field. |
void |
set(String fieldName,
PVField value)
Set the
PVField (by reference!) as field by given name. |
changeField, getField, getFieldName, getFieldOffset, getNextFieldOffset, getNumberFields, getParent, getPVAuxInfo, getRequesterName, isImmutable, message, postPut, renameField, setData, setImmutable, setPostHandler, setRequester, toString, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getField, getFieldName, getFieldOffset, getNextFieldOffset, getNumberFields, getParent, getPVAuxInfo, isImmutable, postPut, renameField, setImmutable, setPostHandler, setRequester, toString, toString, toString
getRequesterName, message
public BasePVUnion(Union union)
union
- the reflection interface for the PVUnion data.public Union getUnion()
PVUnion
public PVField get()
PVUnion
PVField
value stored in the field.public <T extends PVField> T get(Class<T> c)
PVUnion
PVField
value stored in the field.public int getSelectedIndex()
PVUnion
getSelectedIndex
in interface PVUnion
public String getSelectedFieldName()
PVUnion
getSelectedFieldName
in interface PVUnion
public PVField select(int index)
PVUnion
public PVField select(String fieldName)
PVUnion
public <T extends PVField> T select(Class<T> c, int index)
PVUnion
public <T extends PVField> T select(Class<T> c, String fieldName)
PVUnion
public void set(PVField value)
PVUnion
PVField
(by reference!) as selected field.
If a value is not a valid union field an IllegalArgumentException
exception is thrown.public void set(int index, PVField value)
PVUnion
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.set
in interface PVUnion
index
- index of a field to put.value
- the field to set.PVUnion.select(int)
public void set(String fieldName, PVField value)
PVUnion
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.set
in interface PVUnion
fieldName
- Name of the field to put.value
- the field to set.PVUnion.select(String)
public void serialize(ByteBuffer buffer, SerializableControl flusher)
Serializable
serialize
in interface Serializable
buffer
- serialization buffer.flusher
- flush interface.public void deserialize(ByteBuffer buffer, DeserializableControl control)
Serializable
deserialize
in interface Serializable
buffer
- serialization buffer.control
- deserialization control.Copyright © 2014. All Rights Reserved.