Class Arrays

java.lang.Object
com.sshtools.common.util.Arrays

public class Arrays extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T[]
    add(T obj, T... array)
     
    static boolean
    areEqual(byte[] a, byte[] b)
     
    static boolean
    areEqual(char[] a, char[] b)
     
    static byte[]
    cat(byte[] a, byte[] b)
     
    static byte[]
    copy(byte[] array, int len)
     
    static byte[]
    copy(byte[] array, int offset, int len)
     
    static void
    sort(int[] a)
    Sorts the specified array of ints into ascending numerical order.

    Methods inherited from class java.lang.Object

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

    • Arrays

      public Arrays()
  • Method Details

    • sort

      public static void sort(int[] a)
      Sorts the specified array of ints into ascending numerical order. The sorting algorithm is a tuned quicksort, adapted from Jon L. Bentley and M. Douglas McIlroy's "Engineering a Sort Function", Software-Practice and Experience, Vol. 23(11) P. 1249-1265 (November 1993). This algorithm offers n*log(n) performance on many data sets that cause other quicksorts to degrade to quadratic performance.
      Parameters:
      a - the array to be sorted
    • areEqual

      public static boolean areEqual(byte[] a, byte[] b)
    • add

      public static <T> T[] add(T obj, T... array)
    • areEqual

      public static boolean areEqual(char[] a, char[] b)
    • copy

      public static byte[] copy(byte[] array, int len)
    • copy

      public static byte[] copy(byte[] array, int offset, int len)
    • cat

      public static byte[] cat(byte[] a, byte[] b)