to int array p.ints[2] = 7; //Read from int array int i = p.ints[2]; //Write to long array p.longs[2] = 1000L; //Read from long array long l = p.longs[2]; //Write to Object array p.objects[2] = "Hello"; //Read from Object array Object o = p.objects[2]; //Write to Integer array Integer integer = new Integer(5); p.integers[0] = integer; //Read from Object array integer = p.integers[0]; Following instrumentation we will have
POJO p = new POJO(); //Write to int array ArrayAdvisor.arrayWriteInt(p.ints, 2, 7); //Read from int array int i = ArrayAdvisor.arrayReadInt(p.ints, 2); //Write to long array ArrayAdvisor.arrayWriteLong(p.longs, 2, 1000L); //Read from long array long l = ArrayAdvisor.arrayReadLong(p.longs, 2); //Write to Object array ArrayAdvisor.arrayWriteObject(p.objects, 2, "Hello"); //Read from Object array Object o = ArrayAdvisor.arrayReadObject(p.objects, 2); //Write to Integer array Integer integer = new Integer(5); ArrayAdvisor.arrayWriteObject(p.integers, 0, integer); //Read from Object array integer = ArrayAdvisor.arrayWriteObject(p.integers, 0);
@see DefaultArrayAccessReplacementMethodNames
@param calledClass the class containing the static methods.
@param names contains the names of the methods to replacethe different kinds of array access with.