java.lang.Object
org.yamcs.parameter.ValueArray
Stores parameters of the same type as array
For primitive types, it uses much less memory than having an Value[]
-
Constructor Summary
ConstructorsConstructorDescriptionValueArray(byte[][] r) ValueArray(double[] r) ValueArray(float[] r) ValueArray(String[] r) ValueArray(BitSet bitset, int size) ValueArray(org.yamcs.protobuf.Yamcs.Value.Type type) ValueArray(org.yamcs.protobuf.Yamcs.Value.Type type, int size) ValueArray(org.yamcs.protobuf.Yamcs.Value.Type type, int[] r) ValueArray(org.yamcs.protobuf.Yamcs.Value.Type type, long[] r) ValueArray(org.yamcs.protobuf.Yamcs.Value.Type type, Object[] r) -
Method Summary
Modifier and TypeMethodDescriptiondouble[]get the array as an double[].float[]get the array as an float[].int[]get the array as an int[].long[]get the array as an long[].org.yamcs.protobuf.Yamcs.Value.TypegetType()getValue(int idx) static ValueArraymerge(int[] src, ValueArray... srcValueArray) merges the value arrays srcValueArray into a new array based on idx.voidsetValue(int idx, boolean b) voidintsize()
-
Constructor Details
-
ValueArray
public ValueArray(org.yamcs.protobuf.Yamcs.Value.Type type, int size) -
ValueArray
public ValueArray(org.yamcs.protobuf.Yamcs.Value.Type type) -
ValueArray
public ValueArray(org.yamcs.protobuf.Yamcs.Value.Type type, int[] r) -
ValueArray
public ValueArray(org.yamcs.protobuf.Yamcs.Value.Type type, long[] r) -
ValueArray
public ValueArray(double[] r) -
ValueArray
public ValueArray(float[] r) -
ValueArray
public ValueArray(byte[][] r) -
ValueArray
-
ValueArray
-
ValueArray
-
-
Method Details
-
setValue
public void setValue(int idx, boolean b) -
setValue
-
getValue
-
getType
public org.yamcs.protobuf.Yamcs.Value.Type getType() -
getIntArray
public int[] getIntArray()get the array as an int[]. Throws aClassCastExceptionif the array's type is not one ofYamcs.Value.Type.UINT32orYamcs.Value.Type.SINT32- Returns:
-
getLongArray
public long[] getLongArray()get the array as an long[]. Throws aClassCastExceptionif the array's type is not one ofYamcs.Value.Type.UINT64,Yamcs.Value.Type.SINT64orYamcs.Value.Type.TIMESTAMP- Returns:
-
getFloatArray
public float[] getFloatArray()get the array as an float[]. Throws aClassCastExceptionif the array is not ofYamcs.Value.Type.FLOATtype- Returns:
-
getDoubleArray
public double[] getDoubleArray()get the array as an double[]. Throws aClassCastExceptionif the array is not ofYamcs.Value.Type.DOUBLEtype- Returns:
-
size
public int size() -
merge
merges the value arrays srcValueArray into a new array based on idx. The returned array has the size of the sum of the sizes of srcValueArray arrays. The src[] array has the length of the returned array and for each element i of the returned array src[i] says which of the inputValueArray is used. The types of the inputValueArray arrays have to be the same and that will also be the type of the returned array.- Parameters:
src- - an array indicating which from the srcValueArray is the source of the data for each indexsrcValueArray- the source elements- Returns:
- a new array representing the merge of the input arrays
-