Class ArrayReflection


  • public final class ArrayReflection
    extends java.lang.Object
    Utilities for Array reflection.
    • Constructor Summary

      Constructors 
      Constructor Description
      ArrayReflection()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object get​(java.lang.Object array, int index)
      Returns the value of the indexed component in the supplied array.
      static int getLength​(java.lang.Object array)
      Returns the length of the supplied array.
      static java.lang.Object newInstance​(java.lang.Class c, int size)
      Creates a new array with the specified component type and length.
      static void set​(java.lang.Object array, int index, java.lang.Object value)
      Sets the value of the indexed component in the supplied array to the supplied value.
      • Methods inherited from class java.lang.Object

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

      • ArrayReflection

        public ArrayReflection()
    • Method Detail

      • newInstance

        public static java.lang.Object newInstance​(java.lang.Class c,
                                                   int size)
        Creates a new array with the specified component type and length.
      • getLength

        public static int getLength​(java.lang.Object array)
        Returns the length of the supplied array.
      • get

        public static java.lang.Object get​(java.lang.Object array,
                                           int index)
        Returns the value of the indexed component in the supplied array.
      • set

        public static void set​(java.lang.Object array,
                               int index,
                               java.lang.Object value)
        Sets the value of the indexed component in the supplied array to the supplied value.