Class CollectionNumbers

java.lang.Object
org.yamcs.studio.data.vtype.CollectionNumbers

public class CollectionNumbers extends Object
Utilities to work with number collections.
  • Method Details

    • wrappedArray

      public static Object wrappedArray(CollectionNumber coll)
      If available, return the array wrapped by the collection - USE WITH CAUTION AS IT EXPOSES THE INTERNAL STATE OF THE COLLECTION. This is provided in case an external routine for computation requires you to use array, and you want to avoid the copy for performance reason.
      Parameters:
      coll - the collection
      Returns:
      the array or null
    • wrappedFloatArray

      public static float[] wrappedFloatArray(CollectionNumber coll)
      If available, return the array wrapped by the collection - USE WITH CAUTION AS IT EXPOSES THE INTERNAL STATE OF THE COLLECTION. This is provided in case an external routine for computation requires you to use array, and you want to avoid the copy for performance reason.
      Parameters:
      coll - the collection
      Returns:
      the array or null
    • wrappedDoubleArray

      public static double[] wrappedDoubleArray(CollectionNumber coll)
      If available, return the array wrapped by the collection - USE WITH CAUTION AS IT EXPOSES THE INTERNAL STATE OF THE COLLECTION. This is provided in case an external routine for computation requires you to use array, and you want to avoid the copy for performance reason.
      Parameters:
      coll - the collection
      Returns:
      the array or null
    • wrappedByteArray

      public static byte[] wrappedByteArray(CollectionNumber coll)
      If available, return the array wrapped by the collection - USE WITH CAUTION AS IT EXPOSES THE INTERNAL STATE OF THE COLLECTION. This is provided in case an external routine for computation requires you to use array, and you want to avoid the copy for performance reason.
      Parameters:
      coll - the collection
      Returns:
      the array or null
    • wrappedShortArray

      public static short[] wrappedShortArray(CollectionNumber coll)
      If available, return the array wrapped by the collection - USE WITH CAUTION AS IT EXPOSES THE INTERNAL STATE OF THE COLLECTION. This is provided in case an external routine for computation requires you to use array, and you want to avoid the copy for performance reason.
      Parameters:
      coll - the collection
      Returns:
      the array or null
    • wrappedIntArray

      public static int[] wrappedIntArray(CollectionNumber coll)
      If available, return the array wrapped by the collection - USE WITH CAUTION AS IT EXPOSES THE INTERNAL STATE OF THE COLLECTION. This is provided in case an external routine for computation requires you to use array, and you want to avoid the copy for performance reason.
      Parameters:
      coll - the collection
      Returns:
      the array or null
    • wrappedLongArray

      public static long[] wrappedLongArray(CollectionNumber coll)
      If available, return the array wrapped by the collection - USE WITH CAUTION AS IT EXPOSES THE INTERNAL STATE OF THE COLLECTION. This is provided in case an external routine for computation requires you to use array, and you want to avoid the copy for performance reason.
      Parameters:
      coll - the collection
      Returns:
      the array or null
    • floatArrayCopyOf

      public static float[] floatArrayCopyOf(CollectionNumber coll)
      Copies the content of the collection to an array.
      Parameters:
      coll - the collection
      Returns:
      the array
    • doubleArrayCopyOf

      public static double[] doubleArrayCopyOf(CollectionNumber coll)
      Copies the content of the collection to an array.
      Parameters:
      coll - the collection
      Returns:
      the array
    • byteArrayCopyOf

      public static byte[] byteArrayCopyOf(CollectionNumber coll)
      Copies the content of the collection to an array.
      Parameters:
      coll - the collection
      Returns:
      the array
    • shortArrayCopyOf

      public static short[] shortArrayCopyOf(CollectionNumber coll)
      Copies the content of the collection to an array.
      Parameters:
      coll - the collection
      Returns:
      the array
    • intArrayCopyOf

      public static int[] intArrayCopyOf(CollectionNumber coll)
      Copies the content of the collection to an array.
      Parameters:
      coll - the collection
      Returns:
      the array
    • longArrayCopyOf

      public static long[] longArrayCopyOf(CollectionNumber coll)
      Copies the content of the collection to an array.
      Parameters:
      coll - the collection
      Returns:
      the array
    • floatArrayWrappedOrCopy

      public static float[] floatArrayWrappedOrCopy(CollectionNumber coll)
      Returns either the wrapped array (if exists and matches the type) or a copy - USE WITH CAUTION AS IT MAY EXPOSE THE INTERNAL STATE OF THE COLLECTION.
      Parameters:
      coll - the collection
      Returns:
      the array
    • doubleArrayWrappedOrCopy

      public static double[] doubleArrayWrappedOrCopy(CollectionNumber coll)
      Returns either the wrapped array (if exists and matches the type) or a copy - USE WITH CAUTION AS IT MAY EXPOSE THE INTERNAL STATE OF THE COLLECTION.
      Parameters:
      coll - the collection
      Returns:
      the array
    • byteArrayWrappedOrCopy

      public static byte[] byteArrayWrappedOrCopy(CollectionNumber coll)
      Returns either the wrapped array (if exists and matches the type) or a copy - USE WITH CAUTION AS IT MAY EXPOSE THE INTERNAL STATE OF THE COLLECTION.
      Parameters:
      coll - the collection
      Returns:
      the array
    • shortArrayWrappedOrCopy

      public static short[] shortArrayWrappedOrCopy(CollectionNumber coll)
      Returns either the wrapped array (if exists and matches the type) or a copy - USE WITH CAUTION AS IT MAY EXPOSE THE INTERNAL STATE OF THE COLLECTION.
      Parameters:
      coll - the collection
      Returns:
      the array
    • intArrayWrappedOrCopy

      public static int[] intArrayWrappedOrCopy(CollectionNumber coll)
      Returns either the wrapped array (if exists and matches the type) or a copy - USE WITH CAUTION AS IT MAY EXPOSE THE INTERNAL STATE OF THE COLLECTION.
      Parameters:
      coll - the collection
      Returns:
      the array
    • longArrayWrappedOrCopy

      public static long[] longArrayWrappedOrCopy(CollectionNumber coll)
      Returns either the wrapped array (if exists and matches the type) or a copy - USE WITH CAUTION AS IT MAY EXPOSE THE INTERNAL STATE OF THE COLLECTION.
      Parameters:
      coll - the collection
      Returns:
      the array