예제 #1
0
파일: TArray.java 프로젝트: keppelcao/LGame
 protected T[] resize(int newSize) {
   T[] items = this.items;
   T[] newItems = (T[]) new Object[newSize];
   System.arraycopy(items, 0, newItems, 0, MathUtils.min(size, newItems.length));
   this.items = newItems;
   return newItems;
 }
예제 #2
0
 /**
  * A simple constructor
  *
  * @param data data
  * @param nbins nbins
  */
 public Histogram(double[] data, int nbins) {
   double min = MathUtils.min(data);
   double max = MathUtils.max(data);
   setHistogram(data, nbins, min, max);
 }
예제 #3
0
 public Histogram(double[] data) {
   double min = MathUtils.min(data);
   double max = MathUtils.max(data);
   setHistogram(data, 15, min, max);
 }
예제 #4
0
 public static IntHashMap.Entry[] copyOf(IntHashMap.Entry[] obj, int newSize) {
   IntHashMap.Entry tempArr[] = new IntHashMap.Entry[newSize];
   System.arraycopy(obj, 0, tempArr, 0, MathUtils.min(obj.length, newSize));
   return tempArr;
 }
예제 #5
0
 public static LTexture[] copyOf(LTexture[] obj, int newSize) {
   LTexture tempArr[] = new LTexture[newSize];
   System.arraycopy(obj, 0, tempArr, 0, MathUtils.min(obj.length, newSize));
   return tempArr;
 }
예제 #6
0
 public static PSortableObject[] copyOf(PSortableObject[] obj, int newSize) {
   PSortableObject tempArr[] = new PSortableObject[newSize];
   System.arraycopy(obj, 0, tempArr, 0, MathUtils.min(obj.length, newSize));
   return tempArr;
 }
예제 #7
0
 public static PBody[] copyOf(PBody[] obj, int newSize) {
   PBody tempArr[] = new PBody[newSize];
   System.arraycopy(obj, 0, tempArr, 0, MathUtils.min(obj.length, newSize));
   return tempArr;
 }
예제 #8
0
 public static PConvexPolygonShape[] copyOf(PConvexPolygonShape[] obj, int newSize) {
   PConvexPolygonShape tempArr[] = new PConvexPolygonShape[newSize];
   System.arraycopy(obj, 0, tempArr, 0, MathUtils.min(obj.length, newSize));
   return tempArr;
 }
예제 #9
0
 /**
  * copy指定长度的数组数据
  *
  * @param obj
  * @param newSize
  * @return
  */
 public static boolean[] copyOf(boolean[] obj, int newSize) {
   boolean tempArr[] = new boolean[newSize];
   System.arraycopy(obj, 0, tempArr, 0, MathUtils.min(obj.length, newSize));
   return tempArr;
 }
예제 #10
0
 /**
  * copy指定长度的数组数据
  *
  * @param obj
  * @param newSize
  * @return
  */
 public static long[] copyOf(long[] obj, int newSize) {
   long tempArr[] = new long[newSize];
   System.arraycopy(obj, 0, tempArr, 0, MathUtils.min(obj.length, newSize));
   return tempArr;
 }
예제 #11
0
 /**
  * copy指定长度的数组数据
  *
  * @param obj
  * @param newSize
  * @return
  */
 public static char[] copyOf(char[] obj, int newSize) {
   char tempArr[] = new char[newSize];
   System.arraycopy(obj, 0, tempArr, 0, MathUtils.min(obj.length, newSize));
   return tempArr;
 }
예제 #12
0
 /**
  * copy指定长度的数组数据
  *
  * @param obj
  * @param newSize
  * @return
  */
 public static float[] copyOf(float[] obj, int newSize) {
   float tempArr[] = new float[newSize];
   System.arraycopy(obj, 0, tempArr, 0, MathUtils.min(obj.length, newSize));
   return tempArr;
 }