Class BufferUtils

java.lang.Object
org.jbox2d.common.BufferUtils

public class BufferUtils extends Object
Author:
Daniel Murphy
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float[]
    reallocateBuffer(float[] oldBuffer, int oldCapacity, int newCapacity)
    Reallocate a buffer.
    static float[]
    reallocateBuffer(float[] buffer, int userSuppliedCapacity, int oldCapacity, int newCapacity, boolean deferred)
    Reallocate a float buffer.
    static int[]
    reallocateBuffer(int[] oldBuffer, int oldCapacity, int newCapacity)
    Reallocate a buffer.
    static int[]
    reallocateBuffer(int[] buffer, int userSuppliedCapacity, int oldCapacity, int newCapacity, boolean deferred)
    Reallocate an int buffer.
    static <T> T[]
    reallocateBuffer(Class<T> klass, T[] oldBuffer, int oldCapacity, int newCapacity)
    Reallocate a buffer.
    static <T> T[]
    reallocateBuffer(Class<T> klass, T[] buffer, int userSuppliedCapacity, int oldCapacity, int newCapacity, boolean deferred)
    Reallocate a buffer.
    static void
    rotate(float[] ray, int first, int new_first, int last)
    Rotate an array, see std::rotate
    static void
    rotate(int[] ray, int first, int new_first, int last)
    Rotate an array, see std::rotate
    static <T> void
    rotate(T[] ray, int first, int new_first, int last)
    Rotate an array, see std::rotate

    Methods inherited from class java.lang.Object

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

    • BufferUtils

      public BufferUtils()
  • Method Details

    • reallocateBuffer

      public static <T> T[] reallocateBuffer(Class<T> klass, T[] oldBuffer, int oldCapacity, int newCapacity)
      Reallocate a buffer.
    • reallocateBuffer

      public static int[] reallocateBuffer(int[] oldBuffer, int oldCapacity, int newCapacity)
      Reallocate a buffer.
    • reallocateBuffer

      public static float[] reallocateBuffer(float[] oldBuffer, int oldCapacity, int newCapacity)
      Reallocate a buffer.
    • reallocateBuffer

      public static <T> T[] reallocateBuffer(Class<T> klass, T[] buffer, int userSuppliedCapacity, int oldCapacity, int newCapacity, boolean deferred)
      Reallocate a buffer. A 'deferred' buffer is reallocated only if it is not NULL. If 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept.
    • reallocateBuffer

      public static int[] reallocateBuffer(int[] buffer, int userSuppliedCapacity, int oldCapacity, int newCapacity, boolean deferred)
      Reallocate an int buffer. A 'deferred' buffer is reallocated only if it is not NULL. If 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept.
    • reallocateBuffer

      public static float[] reallocateBuffer(float[] buffer, int userSuppliedCapacity, int oldCapacity, int newCapacity, boolean deferred)
      Reallocate a float buffer. A 'deferred' buffer is reallocated only if it is not NULL. If 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept.
    • rotate

      public static <T> void rotate(T[] ray, int first, int new_first, int last)
      Rotate an array, see std::rotate
    • rotate

      public static void rotate(int[] ray, int first, int new_first, int last)
      Rotate an array, see std::rotate
    • rotate

      public static void rotate(float[] ray, int first, int new_first, int last)
      Rotate an array, see std::rotate