Logo Search packages:      
Sourcecode: libjson-java version File versions

static int [] net::sf::json::JSONArray::getDimensions ( JSONArray  jsonArray  )  [inline, static]

Returns the number of dimensions suited for a java array.

Definition at line 243 of file JSONArray.java.

References isEmpty().

                                                            {
      // short circuit for empty arrays
      if( jsonArray == null || jsonArray.isEmpty() ){
         return new int[] { 0 };
      }

      List dims = new ArrayList();
      processArrayDimensions( jsonArray, dims, 0 );
      int[] dimensions = new int[dims.size()];
      int j = 0;
      for( Iterator i = dims.iterator(); i.hasNext(); ){
         dimensions[j++] = ((Integer) i.next()).intValue();
      }
      return dimensions;
   }


Generated by  Doxygen 1.6.0   Back to index