Class GetHelper


  • public class GetHelper
    extends Object
    GetHelper is a utility class with methods to help application level code copy the contents of PVData array types out to Java vectors.

    As described in the pvDataJava Reference Guide on the pvField data interface, a "caller must be prepared to make multiple calls to retrieve or put an entire array." The methods of GetHelper make those multiple calls assuming the caller wishes to get all the values of the whole array. The returned types are Vectors so that the required size need not be known by the caller.

    If the calling code will know the size of the returned data a priori, then see also the utilities in Convert.

    Author:
    Greg White, SLAC, 2012
    See Also:
    pvDataJava Reference Guide, pvField data interface, Convert
    • Constructor Detail

      • GetHelper

        public GetHelper()
    • Method Detail

      • getDoubleVector

        public static Vector<Double> getDoubleVector​(PVDoubleArray pv)
        Copy out the entire array of doubles into a Vector of Double.
        Parameters:
        pv - the PVDoubleArray to copy to
        Returns:
        the Vector containg the values from the specified array
      • getLongVector

        public static Vector<Long> getLongVector​(PVLongArray pv)
        Copy out the entire array of longs into a Vector of Long.
        Parameters:
        pv - the PVLongArray to copy to
        Returns:
        the Vector containg the values from the specified array
      • getByteVector

        public static Vector<Byte> getByteVector​(PVByteArray pv)
        Copy out the entire array of bytes into a Vector of Byte.
        Parameters:
        pv - the PVByteArray to copy to
        Returns:
        the Vector containg the values from the specified array
      • getStringVector

        public static Vector<String> getStringVector​(PVStringArray pv)
        Copy out the entire array of strings into a Vector of String.
        Parameters:
        pv - the PVStringArray to copy to
        Returns:
        the Vector containg the values from the specified array
      • getBooleanVector

        public static Vector<Boolean> getBooleanVector​(PVBooleanArray pv)
        Copy out the entire array of booleans into a Vector of Boolean.
        Parameters:
        pv - the PVBooleanArray to copy to
        Returns:
        the Vector containg the values from the specified array