Package fr.dyade.aaa.common
Class Arrays
- java.lang.Object
-
- fr.dyade.aaa.common.Arrays
-
@Deprecated public class Arrays extends Object
Deprecated.This class is only used in Network and should be replaced by java.util.Arrays class.This class contains various methods for sorting and searching arrays of short.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateArrays()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static intbinarySearch(short[] a, int key)Deprecated.Searches the specified array of ints for the specified value using the binary search algorithm.static booleanequals(short[] a, short[] a2)Deprecated.Returns true if the two specified arrays of shorts are equals.private static intmed3(short[] x, int a, int b, int c)Deprecated.Returns the index of the median of the three indexed integers.private static voidrangeCheck(int arrayLen, int fromIndex, int toIndex)Deprecated.Check that fromIndex and toIndex are in range, and throw an appropriate exception if they aren't.static voidsort(short[] a)Deprecated.Sorts the specified array of ints into ascending numerical order.static voidsort(short[] a, int fromIndex, int toIndex)Deprecated.Sorts the specified range of the specified array of ints into ascending numerical order.private static voidsort1(short[] x, int off, int len)Deprecated.Sorts the specified sub-array of integers into ascending order.private static voidswap(short[] x, int a, int b)Deprecated.Swaps x[a] with x[b].private static voidvecswap(short[] x, int a, int b, int n)Deprecated.Swaps x[a ..
-
-
-
Method Detail
-
sort
public static void sort(short[] a)
Deprecated.Sorts the specified array of ints into ascending numerical order. The sorting algorithm is a tuned quicksort.- Parameters:
a- the array to be sorted.
-
sort
public static void sort(short[] a, int fromIndex, int toIndex)Deprecated.Sorts the specified range of the specified array of ints into ascending numerical order.- Parameters:
a- the array to be sorted.fromIndex- starting index of sub array to sort.toIndex- ending index of sub array to sort.
-
sort1
private static void sort1(short[] x, int off, int len)Deprecated.Sorts the specified sub-array of integers into ascending order.- Parameters:
x- the array to be sorted.off- starting index of sub array to sort.len- number of element of the sub array to sort.
-
swap
private static void swap(short[] x, int a, int b)Deprecated.Swaps x[a] with x[b].- Parameters:
x- the array to handle.a- index of the first element to swap.b- index of the second element to swap.
-
vecswap
private static void vecswap(short[] x, int a, int b, int n)Deprecated.Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].- Parameters:
x- the array to handle.a- index of the first element to swap.b- index of the second element to swap.n- number of elements to swap.
-
med3
private static int med3(short[] x, int a, int b, int c)Deprecated.Returns the index of the median of the three indexed integers.- Parameters:
x- the array to handle.a- index of the first element.b- index of the second element.c- index of the third element.- Returns:
- index of the median.
-
rangeCheck
private static void rangeCheck(int arrayLen, int fromIndex, int toIndex)Deprecated.Check that fromIndex and toIndex are in range, and throw an appropriate exception if they aren't.- Parameters:
arrayLen- len of the array.fromIndex- start index.toIndex- end index.
-
binarySearch
public static int binarySearch(short[] a, int key)Deprecated.Searches the specified array of ints for the specified value using the binary search algorithm. The array must be sorted (as by the sort method, above) prior to making this call.- Parameters:
a- the array to search in.key- the value to search.- Returns:
- the index of element if found, the index to insert it otherwise.
-
equals
public static boolean equals(short[] a, short[] a2)Deprecated.Returns true if the two specified arrays of shorts are equals.- Parameters:
a- the first array.a2- the second array.- Returns:
- true if the two specified arrays of shorts are equals, false otherwise.
-
-