Class ValueUtility

java.lang.Object
org.yamcs.utils.ValueUtility

public class ValueUtility extends Object
  • Constructor Details

    • ValueUtility

      public ValueUtility()
  • Method Details

    • getUint32Value

      public static Value getUint32Value(int x)
    • getSint32Value

      public static Value getSint32Value(int x)
    • getUint64Value

      public static Value getUint64Value(long x)
    • getSint64Value

      public static Value getSint64Value(long x)
    • getStringValue

      public static Value getStringValue(String x)
    • getBinaryValue

      public static Value getBinaryValue(byte[] x)
    • getTimestampValue

      public static Value getTimestampValue(long x)
    • getBooleanValue

      public static Value getBooleanValue(boolean b)
    • getFloatValue

      public static Value getFloatValue(float f)
    • getDoubleValue

      public static Value getDoubleValue(double d)
    • getDoubleGbpValue

      public static Yamcs.Value getDoubleGbpValue(double d)
    • getStringGbpValue

      public static Yamcs.Value getStringGbpValue(String s)
    • getUint32GbpValue

      public static Yamcs.Value getUint32GbpValue(int x)
    • getColumnValue

      public static Value getColumnValue(ColumnDefinition cd, Object v)
    • getYarchValue

      public static Object getYarchValue(Value v)
    • getYarchValue

      public static Object getYarchValue(Yamcs.Value v)
    • getYarchType

      public static DataType getYarchType(Yamcs.Value.Type type)
    • equals

      public static boolean equals(Value a, Value b)
    • compare

      public static int compare(Value a, Value b)
    • toGbp

      public static Yamcs.Value toGbp(Value v)
    • toGbp

      public static Yamcs.AggregateValue toGbp(AggregateValue v)
    • fromGpb

      public static Value fromGpb(Yamcs.Value v)
    • processAsLong

      public static boolean processAsLong(Value v, LongConsumer c)
      if the passed on value is INT32, SINT32, INT64 or SINT64, invoke the function on the long value and return true if v is of other types return false
      Parameters:
      v -
      c -
      Returns:
    • processAsDouble

      public static boolean processAsDouble(Value v, DoubleConsumer c)
      if the passed on value is float, double or integer invoke the function on the double value and return true

      if v is of other types return false

      Parameters:
      v - - the value to be processed
      c - - the function to be invoked with the value transformed to a primitive double
      Returns:
    • processAsDouble1

      public static boolean processAsDouble1(Value v, DoubleConsumer c)
      if the passed on value is FLOAT or DOUBLE, invoke the function on the double value and return true if v is of other types return false
      Parameters:
      v -
      c -
      Returns:
    • getEnumeratedValue

      public static EnumeratedValue getEnumeratedValue(long longValue, String stringValue)
    • getIntValue

      public static Value getIntValue(int sizeInBits, boolean signed, long v)
      Parameters:
      sizeInBits -
      signed -
      v -
      Returns:
    • getFloatValue

      public static Value getFloatValue(int sizeInBits, double v)