Class XArrays


  • public class XArrays
    extends java.lang.Object
    Utilities to work with arrays.

    Since:
    4.5
    Author:
    Javier Paniza
    • Constructor Summary

      Constructors 
      Constructor Description
      XArrays()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean haveSameElements​(int[] array1, int[] array2)
      To know if the two arrays has the same elements.
      static boolean haveSameElements​(java.util.Map[] array1, java.util.Map[] array2)
      To know if the two arrays has the same elements.
      static boolean isArray​(java.lang.Object object)  
      static void move​(java.lang.Object[] array, int from, int to)  
      • Methods inherited from class java.lang.Object

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

      • XArrays

        public XArrays()
    • Method Detail

      • haveSameElements

        public static boolean haveSameElements​(int[] array1,
                                               int[] array2)
        To know if the two arrays has the same elements.

        The order does not matter, a null arrays has the same elements than an arrays with 0 elements.

        Parameters:
        array1 - Can be null
        array2 - Can be null
        Since:
        4.5
      • haveSameElements

        public static boolean haveSameElements​(java.util.Map[] array1,
                                               java.util.Map[] array2)
        To know if the two arrays has the same elements.

        The order does not matter, a null arrays has the same elements than an arrays with 0 elements.

        Parameters:
        array1 - Can be null
        array2 - Can be null
        Since:
        4.7
      • move

        public static void move​(java.lang.Object[] array,
                                int from,
                                int to)
        Since:
        5.6
      • isArray

        public static boolean isArray​(java.lang.Object object)