Package org.epics.pvdata.pv
Interface Convert
-
public interface ConvertConvert between numeric types,convert any field to a string, and convert from a string to a scalar field.- Author:
- mrk
Numeric conversions are between scalar numeric types or between arrays of numeric types. It is not possible to convert between a scalar and an array. Numeric conversions are between types: pvByte, pvShort, pvInt, pvLong, pvFloat, or pvDouble.
getString converts any supported type to a String. Code that implements a PVField interface can implement method toString by calling this method.
fromString converts a String to a scalar. fromStringArray converts an array of String to a pvArray, which must have a scaler element type. A scalar field is a numeric field or pvBoolean or pvString.
All from methods put data into a PVField, e.g. from means where the PVField gets it's data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcopy(PVField from, PVField to)Copy from a PVField to another PVField.voidcopyScalar(PVScalar from, PVScalar to)Copy from a PVScalar to another PVScalar.intcopyScalarArray(PVScalarArray from, int offset, PVScalarArray to, int toOffset, int length)Copy from a source PVScalarArray to a destination PVScalarArray.voidcopyStructure(PVStructure from, PVStructure to)Copy from a PVStructure to another PVStructure.intcopyStructureArray(PVStructureArray from, int offset, PVStructureArray to, int toOffset, int length)Copy from a subset of a PVStructureArray to another PVStructureArray.voidcopyStructureArray(PVStructureArray from, PVStructureArray to)Copy from a PVStructureArray array to another PVStructureArray array.voidcopyUnion(PVUnion from, PVUnion to)Copy from a PVUnion to another PVUnion.intcopyUnionArray(PVUnionArray from, int offset, PVUnionArray to, int toOffset, int length)Copy from a subset of a PVUnionArray to another PVUnionArray.voidcopyUnionArray(PVUnionArray from, PVUnionArray to)Copy from a PVUnionArray to another PVUnionArray.voidfromByte(PVScalar pv, byte from)Convert a PVScalar from a byteintfromByteArray(PVScalarArray pv, int offset, int length, byte[] from, int fromOffset)Convert to a PVScalarArray from a byte array.voidfromDouble(PVScalar pv, double from)Convert a PV from a double.intfromDoubleArray(PVScalarArray pv, int offset, int length, double[] from, int fromOffset)Convert to a PVScalarArray from a double array.voidfromFloat(PVScalar pv, float from)Convert a PV from a float.intfromFloatArray(PVScalarArray pv, int offset, int length, float[] from, int fromOffset)Convert to a PVScalarArray from a float array.voidfromInt(PVScalar pv, int from)Convert a PVScalar from an intintfromIntArray(PVScalarArray pv, int offset, int length, int[] from, int fromOffset)Convert to a PVScalarArray from an int array.voidfromLong(PVScalar pv, long from)Convert a PVScalar from a longintfromLongArray(PVScalarArray pv, int offset, int length, long[] from, int fromOffset)Convert to a PVScalarArray from a long array.voidfromShort(PVScalar pv, short from)Convert a PVScalar from a shortintfromShortArray(PVScalarArray pv, int offset, int length, short[] from, int fromOffset)Convert to a PVScalarArray from a short array.intfromString(PVScalarArray pv, String from)Convert from a String to a PVScalarArray.voidfromString(PVScalar pv, String from)Convert from a String to a PVScalarintfromStringArray(PVScalarArray pv, int offset, int length, String[] from, int fromOffset)Convert from a String array and to a PVScalarArray array.voidfromUByte(PVScalar pv, byte from)Convert a PV from a byte interpreted as unsignedintfromUByteArray(PVScalarArray pv, int offset, int length, byte[] from, int fromOffset)Convert to a PVScalarArray from a byte array interpreted as unsigned.voidfromUInt(PVScalar pv, int from)Convert a PV from an int interpreted as unsignedintfromUIntArray(PVScalarArray pv, int offset, int length, int[] from, int fromOffset)Convert to a PVScalarArray from an int array interpreted as unsigned.voidfromULong(PVScalar pv, long from)Convert a PV from a long interpreted as unsignedintfromULongArray(PVScalarArray pv, int offset, int length, long[] from, int fromOffset)Convert to a PVScalarArray from a long array interpreted as unsigned.voidfromUShort(PVScalar pv, short from)Convert a PV from a short interpreted as unsignedintfromUShortArray(PVScalarArray pv, int offset, int length, short[] from, int fromOffset)Convert to a PVScalarArray from a short array interpreted as unsigned.voidgetFullFieldName(StringBuilder builder, PVField pvField)Get the full fieldName for the PVField and add to a StringBuilder.voidgetString(StringBuilder buf, PVField pv)Convert a PVField to a string.voidgetString(StringBuilder buf, PVField pv, int indentLevel)Convert a PVField to a String.booleanisCopyCompatible(Field from, Field to)Are from and to valid arguments to copy.booleanisCopyScalarArrayCompatible(ScalarArray from, ScalarArray to)Are from and to valid arguments to copyArray.booleanisCopyScalarCompatible(Scalar from, Scalar to)Are from and to the instrospection interfaces for valid arguments for copyScalar.booleanisCopyStructureArrayCompatible(StructureArray from, StructureArray to)Are from and to the instrospection interfaces for valid arguments for copyStructureArray.booleanisCopyStructureCompatible(Structure from, Structure to)Are from and to the instrospection interfaces for valid arguments for copyStructure.booleanisCopyUnionArrayCompatible(UnionArray from, UnionArray to)Are from and to the instrospection interfaces for valid arguments for copyUnionArray.booleanisCopyUnionCompatible(Union from, Union to)Are from and to the instrospection interfaces for valid arguments for copyUnion.voidnewLine(StringBuilder builder, int indentLevel)Convenience method for implementing toString.bytetoByte(PVScalar pv)Convert a PVScalar to a byte.inttoByteArray(PVScalarArray pv, int offset, int length, byte[] to, int toOffset)Convert a PVScalarArray to a byte array.doubletoDouble(PVScalar pv)Convert a PVScalar to a doubleinttoDoubleArray(PVScalarArray pv, int offset, int length, double[] to, int toOffset)Convert a PVScalarArray to a double array.floattoFloat(PVScalar pv)Convert a PVScalar to a floatinttoFloatArray(PVScalarArray pv, int offset, int length, float[] to, int toOffset)Convert a PVScalarArray to a float array.inttoInt(PVScalar pv)Convert a PVScalar to an intinttoIntArray(PVScalarArray pv, int offset, int length, int[] to, int toOffset)Convert a PVScalarArray array to an int array.longtoLong(PVScalar pv)Convert a PVScalar to a longinttoLongArray(PVScalarArray pv, int offset, int length, long[] to, int toOffset)Convert a PVScalarArray to a long array.shorttoShort(PVScalar pv)Convert a PVScalar to a short.inttoShortArray(PVScalarArray pv, int offset, int length, short[] to, int toOffset)Convert a PVScalarArray to a short array.StringtoString(PVScalar pv)Convert a PVScalar to a StringinttoStringArray(PVScalarArray pv, int offset, int length, String[] to, int toOffset)Convert from a PVScalarArray to a String array.
-
-
-
Method Detail
-
getFullFieldName
void getFullFieldName(StringBuilder builder, PVField pvField)
Get the full fieldName for the PVField and add to a StringBuilder.- Parameters:
builder- the StringBuilder that will have the resultpvField- the PVField.
-
getString
void getString(StringBuilder buf, PVField pv, int indentLevel)
Convert a PVField to a String. If a PVField is a structure or array be prepared for a very long string.- Parameters:
buf- the buffer for the resultpv- the PVField to convert to a stringindentLevel- the indentation level
-
getString
void getString(StringBuilder buf, PVField pv)
Convert a PVField to a string. If the PVField is a structure or array be prepared for a very long string.- Parameters:
buf- the buffer for the resultpv- the PVField to convert to a string
-
fromString
void fromString(PVScalar pv, String from)
Convert from a String to a PVScalar- Parameters:
pv- the PVScalar to convert tofrom- the String value to convert from- Throws:
NumberFormatException- if the String does not have a valid value
-
fromString
int fromString(PVScalarArray pv, String from)
Convert from a String to a PVScalarArray. The String must be a comma separated set of values optionally enclosed in [].- Parameters:
pv- the PVScalarArray to convert tofrom- the String value to convert from- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element Type is not a scalarNumberFormatException- if the String is not that of a valid set of array values
-
fromStringArray
int fromStringArray(PVScalarArray pv, int offset, int length, String[] from, int fromOffset)
Convert from a String array and to a PVScalarArray array.- Parameters:
pv- the PVScalarArray to convert tooffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the array of values to put into the PVScalarArrayfromOffset- the starting element in the source array- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element Type is not a scalarNumberFormatException- if the String does not have a valid value
-
toStringArray
int toStringArray(PVScalarArray pv, int offset, int length, String[] to, int toOffset)
Convert from a PVScalarArray to a String array.- Parameters:
pv- the PVScalarArrayoffset- the starting element in the PVScalarArraylength- the number of elements to convert toto- the array to receive the converted PVScalarArray datatoOffset- the element in the destination array at which to start putting the converted data- Returns:
- the number of elements converted
-
isCopyCompatible
boolean isCopyCompatible(Field from, Field to)
Are from and to valid arguments to copy. This first checks of both arguments have the same Type. Then calls one of isCopyScalarCompatible, isCopyArrayCompatible, or isCopyStructureCompatible.- Parameters:
from- the sourceto- the destination- Returns:
- (false,true) is the arguments (are not, are) compatible
-
copy
void copy(PVField from, PVField to)
Copy from a PVField to another PVField. This calls one of copyScalar, copyArray or copyStructure. The two arguments must be compatible.- Parameters:
from- the sourceto- the destination- Throws:
IllegalArgumentException- if the arguments are not compatible
-
isCopyScalarCompatible
boolean isCopyScalarCompatible(Scalar from, Scalar to)
Are from and to the instrospection interfaces for valid arguments for copyScalar. false will be returned if either argument is not a scalar as defined by Type.isScalar(). If both are scalars the return value is true if any of the following are true:- Both arguments are numeric.
- Both arguments have the same type.
- Either argument is a string.
- Parameters:
from- the introspection interface for the from datato- the introspection interface for the to data- Returns:
- (false,true) if the arguments (are not, are) compatible
-
copyScalar
void copyScalar(PVScalar from, PVScalar to)
Copy from a PVScalar to another PVScalar.- Parameters:
from- the sourceto- the destination- Throws:
IllegalArgumentException- if the arguments are not compatible
-
isCopyScalarArrayCompatible
boolean isCopyScalarArrayCompatible(ScalarArray from, ScalarArray to)
Are from and to valid arguments to copyArray. The results are like isCopyScalarCompatible except that the tests are made on the elementType.- Parameters:
from- the introspection interface for a source arrayto- the introspection interface for a destination array- Returns:
- (false,true) if the arguments (are not, are) compatible
-
copyScalarArray
int copyScalarArray(PVScalarArray from, int offset, PVScalarArray to, int toOffset, int length)
Copy from a source PVScalarArray to a destination PVScalarArray.- Parameters:
from- the source PVScalarArrayoffset- the starting element in the sourceto- the destination PVScalarArraytoOffset- the element in the destination array at which to start putting the copied datalength- the number of elements to copy- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the arguments are not compatible
-
isCopyStructureCompatible
boolean isCopyStructureCompatible(Structure from, Structure to)
Are from and to the instrospection interfaces for valid arguments for copyStructure. They are only compatible if they have the same Structure description.- Parameters:
from- the introspection interface for a source structureto- the introspection interface for a destination structure- Returns:
- (false,true) if the arguments (are not, are) compatible
-
copyStructure
void copyStructure(PVStructure from, PVStructure to)
Copy from a PVStructure to another PVStructure. NOTE: Only compatible nodes are copied. This means:- For scalar nodes this means that isCopyScalarCompatible is true.
- For array nodes this means that isCopyArrayCompatible is true.
- For structure nodes this means that isCopyStructureCompatible is true.
- Link nodes are not copied.
- Parameters:
from- the sourceto- the destination- Throws:
IllegalArgumentException- if the arguments are not compatible
-
isCopyUnionCompatible
boolean isCopyUnionCompatible(Union from, Union to)
Are from and to the instrospection interfaces for valid arguments for copyUnion. They are only compatible if they have the same Union description.- Parameters:
from- the introspection interface for the source unionto- the introspection interface for the destination union- Returns:
- (false,true) if the arguments (are not, are) compatible
-
copyUnion
void copyUnion(PVUnion from, PVUnion to)
Copy from a PVUnion to another PVUnion.- Parameters:
from- the sourceto- the destination- Throws:
IllegalArgumentException- if the arguments are not compatible
-
isCopyStructureArrayCompatible
boolean isCopyStructureArrayCompatible(StructureArray from, StructureArray to)
Are from and to the instrospection interfaces for valid arguments for copyStructureArray.- Parameters:
from- the introspection interface for a source arrayto- the introspection interface for a destination array- Returns:
- (false,true) if the arguments (are not, are) compatible
-
isCopyUnionArrayCompatible
boolean isCopyUnionArrayCompatible(UnionArray from, UnionArray to)
Are from and to the instrospection interfaces for valid arguments for copyUnionArray.- Parameters:
from- the from UnionArrayto- the to UnionArray- Returns:
- (false,true) if the arguments (are not, are) compatible
-
copyStructureArray
void copyStructureArray(PVStructureArray from, PVStructureArray to)
Copy from a PVStructureArray array to another PVStructureArray array.- Parameters:
from- the source arrayto- the destination array
-
copyStructureArray
int copyStructureArray(PVStructureArray from, int offset, PVStructureArray to, int toOffset, int length)
Copy from a subset of a PVStructureArray to another PVStructureArray.- Parameters:
from- the source arrayoffset- the element in the source array to start copying atto- the destination arraytoOffset- the element in the destination array at which to start putting the copied datalength- the number of elements to copy- Returns:
- the number of elements copied
-
copyUnionArray
void copyUnionArray(PVUnionArray from, PVUnionArray to)
Copy from a PVUnionArray to another PVUnionArray.- Parameters:
from- the source arrayto- the destination array
-
copyUnionArray
int copyUnionArray(PVUnionArray from, int offset, PVUnionArray to, int toOffset, int length)
Copy from a subset of a PVUnionArray to another PVUnionArray.- Parameters:
from- the source arrayoffset- the element in the source array to start copying atto- the destination arraytoOffset- the element in the destination array at which to start putting the copied datalength- the number of elements to copy- Returns:
- the number of elements copied
-
toByte
byte toByte(PVScalar pv)
Convert a PVScalar to a byte.- Parameters:
pv- the PVScalar to convert- Returns:
- converted value
- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
toShort
short toShort(PVScalar pv)
Convert a PVScalar to a short.- Parameters:
pv- the PVScalar to convert- Returns:
- converted value
- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
toInt
int toInt(PVScalar pv)
Convert a PVScalar to an int- Parameters:
pv- the PVScalar to convert- Returns:
- converted value
- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
toLong
long toLong(PVScalar pv)
Convert a PVScalar to a long- Parameters:
pv- the PVScalar to convert- Returns:
- converted value
- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
toFloat
float toFloat(PVScalar pv)
Convert a PVScalar to a float- Parameters:
pv- the PVScalar to convert- Returns:
- converted value
- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
toDouble
double toDouble(PVScalar pv)
Convert a PVScalar to a double- Parameters:
pv- the PVScalar to convert- Returns:
- converted value
- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
toString
String toString(PVScalar pv)
Convert a PVScalar to a String- Parameters:
pv- the PVScalar to convert- Returns:
- converted value
-
fromByte
void fromByte(PVScalar pv, byte from)
Convert a PVScalar from a byte- Parameters:
pv- a PVScalarfrom- value to put into PVScalar- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
fromShort
void fromShort(PVScalar pv, short from)
Convert a PVScalar from a short- Parameters:
pv- a PVScalarfrom- value to put into PVScalar- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
fromInt
void fromInt(PVScalar pv, int from)
Convert a PVScalar from an int- Parameters:
pv- a PVScalarfrom- the value to put into the PVScalar- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
fromLong
void fromLong(PVScalar pv, long from)
Convert a PVScalar from a long- Parameters:
pv- a PVScalarfrom- the value to put into the PVScalar- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
fromUByte
void fromUByte(PVScalar pv, byte from)
Convert a PV from a byte interpreted as unsigned- Parameters:
pv- a PVfrom- the value to put into the PV- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
fromUShort
void fromUShort(PVScalar pv, short from)
Convert a PV from a short interpreted as unsigned- Parameters:
pv- a PVfrom- the value to put into the PV- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
fromUInt
void fromUInt(PVScalar pv, int from)
Convert a PV from an int interpreted as unsigned- Parameters:
pv- a PVfrom- the value to put into the PV- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
fromULong
void fromULong(PVScalar pv, long from)
Convert a PV from a long interpreted as unsigned- Parameters:
pv- a PVfrom- the value to put into the PV- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
fromFloat
void fromFloat(PVScalar pv, float from)
Convert a PV from a float.- Parameters:
pv- a PVfrom- the value to put into the PV- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
fromDouble
void fromDouble(PVScalar pv, double from)
Convert a PV from a double.- Parameters:
pv- a PVfrom- the value to put into the PV- Throws:
IllegalArgumentException- if the ScalarType of pv is not a numeric scalar
-
toByteArray
int toByteArray(PVScalarArray pv, int offset, int length, byte[] to, int toOffset)
Convert a PVScalarArray to a byte array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray to start converting atlength- the number of elements to convertto- the array to put the converted PVScalarArray data intotoOffset- the element in the destination array at which to start putting the converted data- Returns:
- number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
toShortArray
int toShortArray(PVScalarArray pv, int offset, int length, short[] to, int toOffset)
Convert a PVScalarArray to a short array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray to start converting atlength- the number of elements to convertto- the array to put the converted PVScalarArray data intotoOffset- the element in the destination array at which to start putting the converted data- Returns:
- number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
toIntArray
int toIntArray(PVScalarArray pv, int offset, int length, int[] to, int toOffset)
Convert a PVScalarArray array to an int array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray to start converting atlength- the number of elements to convertto- the array to put the converted PVScalarArray data intotoOffset- the element in the destination array at which to start putting the converted data- Returns:
- number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
toLongArray
int toLongArray(PVScalarArray pv, int offset, int length, long[] to, int toOffset)
Convert a PVScalarArray to a long array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray to start converting atlength- the number of elements to convertto- the array to put the converted PVScalarArray data intotoOffset- the element in the destination array at which to start putting the converted data- Returns:
- number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
toFloatArray
int toFloatArray(PVScalarArray pv, int offset, int length, float[] to, int toOffset)
Convert a PVScalarArray to a float array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray to start converting atlength- the number of elements to convertto- the array to put the converted PVScalarArray data intotoOffset- the element in the destination array at which to start putting the converted data- Returns:
- number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
toDoubleArray
int toDoubleArray(PVScalarArray pv, int offset, int length, double[] to, int toOffset)
Convert a PVScalarArray to a double array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray to start converting atlength- the number of elements to convertto- the array to put the converted PVScalarArray data intotoOffset- the element in the destination array at which to start putting the converted data- Returns:
- number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromByteArray
int fromByteArray(PVScalarArray pv, int offset, int length, byte[] from, int fromOffset)
Convert to a PVScalarArray from a byte array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromShortArray
int fromShortArray(PVScalarArray pv, int offset, int length, short[] from, int fromOffset)
Convert to a PVScalarArray from a short array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromIntArray
int fromIntArray(PVScalarArray pv, int offset, int length, int[] from, int fromOffset)
Convert to a PVScalarArray from an int array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromLongArray
int fromLongArray(PVScalarArray pv, int offset, int length, long[] from, int fromOffset)
Convert to a PVScalarArray from a long array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromUByteArray
int fromUByteArray(PVScalarArray pv, int offset, int length, byte[] from, int fromOffset)
Convert to a PVScalarArray from a byte array interpreted as unsigned.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromUShortArray
int fromUShortArray(PVScalarArray pv, int offset, int length, short[] from, int fromOffset)
Convert to a PVScalarArray from a short array interpreted as unsigned.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromUIntArray
int fromUIntArray(PVScalarArray pv, int offset, int length, int[] from, int fromOffset)
Convert to a PVScalarArray from an int array interpreted as unsigned.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromULongArray
int fromULongArray(PVScalarArray pv, int offset, int length, long[] from, int fromOffset)
Convert to a PVScalarArray from a long array interpreted as unsigned.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromFloatArray
int fromFloatArray(PVScalarArray pv, int offset, int length, float[] from, int fromOffset)
Convert to a PVScalarArray from a float array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
fromDoubleArray
int fromDoubleArray(PVScalarArray pv, int offset, int length, double[] from, int fromOffset)
Convert to a PVScalarArray from a double array.- Parameters:
pv- a PVScalarArrayoffset- the element in the PVScalarArray at which to start putting the converted datalength- the number of elements to convertfrom- the source array to put into the PVScalarArrayfromOffset- the element in the source array to start converting at- Returns:
- the number of elements converted
- Throws:
IllegalArgumentException- if the element type of pv is not numeric
-
newLine
void newLine(StringBuilder builder, int indentLevel)
Convenience method for implementing toString. It generates a newline and inserts blanks at the beginning of the newline.- Parameters:
builder- the StringBuilder being constructedindentLevel- indentation level. Each level is four spaces.
-
-