So before this index came in if you see the array-type branch this is what I would have done. Now inorder to get the result inside an array with the specified index I had done this way.  
So for queries like 
SELECT a_double_array[1] FROM table_with_array
User would say rs.getDouble() or rs.getArray()?  Currently my implementation goes with getArray and hence I had to work with the toObject method in PDataTypeForArray.