Class ArrayUtils

java.lang.Object
org.oscim.utils.ArrayUtils

public class ArrayUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    parseNumber(char[] str, int pos, int end)
     
    static void
    reverse(byte[] data, int left, int right, int stride)
    Reverse the array for primitive byte.
    static void
    reverse(float[] data, int left, int right, int stride)
    Reverse the array for primitive float.
    static void
    reverse(short[] data, int left, int right, int stride)
    Reverse the array for primitive short.
    static <T> void
    reverse(T[] data)
     
    static <T> void
    reverse(T[] data, int left, int right)
     
    static <T> void
    reverse(T[] data, int left, int right, int stride)
    Reverse an array.
    static void
    setBox2D(float[] bbox, float xmin, float ymin, float xmax, float ymax)
    Set bbox array to: xmin, ymin, xmin, ymax, xmax, ymax, xmax, ymin,
    static <K, V> Map<V,K>
    swap(Map<K,V> map)
     
    static boolean
    withinRange(float[] vec, float min, float max)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ArrayUtils

      public ArrayUtils()
  • Method Details

    • reverse

      public static <T> void reverse(T[] data)
    • reverse

      public static <T> void reverse(T[] data, int left, int right)
    • reverse

      public static <T> void reverse(T[] data, int left, int right, int stride)
      Reverse an array.
      Parameters:
      data - the base array to be reversed
      left - the left index to be reversed
      right - the right index (excluded)
      stride - the stride
    • reverse

      public static void reverse(short[] data, int left, int right, int stride)
      Reverse the array for primitive short. see reverse(Object[], int, int, int)
    • reverse

      public static void reverse(float[] data, int left, int right, int stride)
      Reverse the array for primitive float. see reverse(Object[], int, int, int)
    • reverse

      public static void reverse(byte[] data, int left, int right, int stride)
      Reverse the array for primitive byte. see reverse(Object[], int, int, int)
    • parseNumber

      public static double parseNumber(char[] str, int pos, int end)
    • swap

      public static <K, V> Map<V,K> swap(Map<K,V> map)
      Returns:
      the Map with swapped keys and values
    • withinRange

      public static boolean withinRange(float[] vec, float min, float max)
    • setBox2D

      public static void setBox2D(float[] bbox, float xmin, float ymin, float xmax, float ymax)
      Set bbox array to: xmin, ymin, xmin, ymax, xmax, ymax, xmax, ymin,