Package org.epics.pvdata.factory
Class BasePVUnionArray
- java.lang.Object
-
- org.epics.pvdata.factory.AbstractPVField
-
- org.epics.pvdata.factory.AbstractPVArray
-
- org.epics.pvdata.factory.AbstractPVComplexArray
-
- org.epics.pvdata.factory.BasePVUnionArray
-
- All Implemented Interfaces:
PVArray,PVField,PVUnionArray,Serializable,SerializableArray
public class BasePVUnionArray extends AbstractPVComplexArray implements PVUnionArray
Base class for implementing PVUnionArray.- Author:
- mse
-
-
Field Summary
Fields Modifier and Type Field Description protected UnionArrayunionArrayprotected PVUnion[]value-
Fields inherited from class org.epics.pvdata.factory.AbstractPVArray
capacity, capacityMutable, length
-
Fields inherited from class org.epics.pvdata.factory.AbstractPVField
convert
-
-
Constructor Summary
Constructors Constructor Description BasePVUnionArray(UnionArray unionArray)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidallocate(int newCapacity)protected SerializablecreateNewInstance()intget(int offset, int len, UnionArrayData data)Get values from a PVUnionArray and put them into PVUnion[]to.protected SerializablegetAt(int index)UnionArraygetUnionArray()Get the introspection interface.protected ObjectgetValue()inthashCode()intput(int offset, int len, PVUnion[] from, int fromOffset)Put values into a PVUnionArray from PVUnion[]fromprotected voidsetAt(int index, Serializable obj)protected voidsetValue(Object array)voidshareData(PVUnion[] from)Share the data from caller.protected booleanvalueEquals(Object obj)-
Methods inherited from class org.epics.pvdata.factory.AbstractPVComplexArray
deserialize, serialize
-
Methods inherited from class org.epics.pvdata.factory.AbstractPVArray
equals, getArray, getCapacity, getLength, internalGet, internalPut, internalShareData, isCapacityMutable, put, serialize, setCapacity, setCapacityMutable, setImmutable, setLength
-
Methods inherited from class org.epics.pvdata.factory.AbstractPVField
changeField, getField, getFieldName, getFieldOffset, getFullName, getNextFieldOffset, getNumberFields, getParent, isImmutable, postPut, setData, setPostHandler, toString, toString, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.epics.pvdata.pv.PVArray
getArray, getCapacity, getLength, isCapacityMutable, setCapacity, setCapacityMutable, setLength
-
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
-
Methods inherited from interface org.epics.pvdata.pv.SerializableArray
serialize
-
-
-
-
Field Detail
-
value
protected PVUnion[] value
-
unionArray
protected UnionArray unionArray
-
-
Constructor Detail
-
BasePVUnionArray
public BasePVUnionArray(UnionArray unionArray)
Constructor.- Parameters:
unionArray- The Introspection interface.
-
-
Method Detail
-
getUnionArray
public UnionArray getUnionArray()
Description copied from interface:PVUnionArrayGet the introspection interface.- Specified by:
getUnionArrayin interfacePVUnionArray- Returns:
- The interface.
-
allocate
protected void allocate(int newCapacity)
- Specified by:
allocatein classAbstractPVArray
-
getValue
protected Object getValue()
- Specified by:
getValuein classAbstractPVArray
-
setValue
protected void setValue(Object array)
- Specified by:
setValuein classAbstractPVArray
-
get
public int get(int offset, int len, UnionArrayData data)Description copied from interface:PVUnionArrayGet values from a PVUnionArray and put them into PVUnion[]to.- Specified by:
getin interfacePVUnionArray- Parameters:
offset- the offset to the first element to getlen- the maximum number of elements to transferdata- the class containing the data and an offset into the data. Get sets these values. The caller must do the actual data transfer.- Returns:
- the number of elements that can be transfered. This is always less than or equal to length. If the value is less then length then get should be called again. If the return value is greater than 0 then data.data is a reference to the array and data.offset is the offset into the array.
-
put
public int put(int offset, int len, PVUnion[] from, int fromOffset)Description copied from interface:PVUnionArrayPut values into a PVUnionArray from PVUnion[]from- Specified by:
putin interfacePVUnionArray- Parameters:
offset- the offset to the first element to putlen- the maximum number of elements to transferfrom- the array from which to get the data.fromOffset- the offset into from- Returns:
- the number of elements transfered. This is always less than or equal to length. If the value is less than the length then put should be called again.
-
shareData
public void shareData(PVUnion[] from)
Description copied from interface:PVUnionArrayShare the data from caller. The capacity and length are taken from the array and this array is made immutable. This should only be used to share immutable data.- Specified by:
shareDatain interfacePVUnionArray- Parameters:
from- the data to share
-
valueEquals
protected boolean valueEquals(Object obj)
- Specified by:
valueEqualsin classAbstractPVArray
-
getAt
protected Serializable getAt(int index)
- Specified by:
getAtin classAbstractPVComplexArray
-
setAt
protected void setAt(int index, Serializable obj)- Specified by:
setAtin classAbstractPVComplexArray
-
createNewInstance
protected Serializable createNewInstance()
- Specified by:
createNewInstancein classAbstractPVComplexArray
-
-