@@ -180,10 +180,16 @@ public JSONArray(Collection<?> collection) {
180180 }
181181
182182 /**
183- * Construct a JSONArray from an array
183+ * Construct a JSONArray from an array.
184+ *
185+ * @param array
186+ * Array. If the parameter passed is null, or not an array, an
187+ * exception will be thrown.
184188 *
185189 * @throws JSONException
186- * If not an array or if an array value is non-finite number.
190+ * If not an array or if an array value is non-finite number.
191+ * @throws NullPointerException
192+ * Thrown if the array parameter is null.
187193 */
188194 public JSONArray (Object array ) throws JSONException {
189195 this ();
@@ -310,17 +316,19 @@ public Number getNumber(int index) throws JSONException {
310316 }
311317
312318 /**
313- * Get the enum value associated with an index.
314- *
315- * @param clazz
316- * The type of enum to retrieve.
317- * @param index
318- * The index must be between 0 and length() - 1.
319- * @return The enum value at the index location
320- * @throws JSONException
321- * if the key is not found or if the value cannot be converted
322- * to an enum.
323- */
319+ * Get the enum value associated with an index.
320+ *
321+ * @param <E>
322+ * Enum Type
323+ * @param clazz
324+ * The type of enum to retrieve.
325+ * @param index
326+ * The index must be between 0 and length() - 1.
327+ * @return The enum value at the index location
328+ * @throws JSONException
329+ * if the key is not found or if the value cannot be converted
330+ * to an enum.
331+ */
324332 public <E extends Enum <E >> E getEnum (Class <E > clazz , int index ) throws JSONException {
325333 E val = optEnum (clazz , index );
326334 if (val ==null ) {
@@ -334,7 +342,10 @@ public <E extends Enum<E>> E getEnum(Class<E> clazz, int index) throws JSONExcep
334342 }
335343
336344 /**
337- * Get the BigDecimal value associated with an index.
345+ * Get the BigDecimal value associated with an index. If the value is float
346+ * or double, the the {@link BigDecimal#BigDecimal(double)} constructor
347+ * will be used. See notes on the constructor for conversion issues that
348+ * may arise.
338349 *
339350 * @param index
340351 * The index must be between 0 and length() - 1.
@@ -683,6 +694,8 @@ public int optInt(int index, int defaultValue) {
683694 /**
684695 * Get the enum value associated with a key.
685696 *
697+ * @param <E>
698+ * Enum Type
686699 * @param clazz
687700 * The type of enum to retrieve.
688701 * @param index
@@ -696,6 +709,8 @@ public <E extends Enum<E>> E optEnum(Class<E> clazz, int index) {
696709 /**
697710 * Get the enum value associated with a key.
698711 *
712+ * @param <E>
713+ * Enum Type
699714 * @param clazz
700715 * The type of enum to retrieve.
701716 * @param index
@@ -725,7 +740,6 @@ public <E extends Enum<E>> E optEnum(Class<E> clazz, int index, E defaultValue)
725740 }
726741 }
727742
728-
729743 /**
730744 * Get the optional BigInteger value associated with an index. The
731745 * defaultValue is returned if there is no value for the index, or if the
@@ -745,7 +759,10 @@ public BigInteger optBigInteger(int index, BigInteger defaultValue) {
745759 /**
746760 * Get the optional BigDecimal value associated with an index. The
747761 * defaultValue is returned if there is no value for the index, or if the
748- * value is not a number and cannot be converted to a number.
762+ * value is not a number and cannot be converted to a number. If the value
763+ * is float or double, the the {@link BigDecimal#BigDecimal(double)}
764+ * constructor will be used. See notes on the constructor for conversion
765+ * issues that may arise.
749766 *
750767 * @param index
751768 * The index must be between 0 and length() - 1.
@@ -1192,8 +1209,8 @@ public Object query(String jsonPointer) {
11921209 }
11931210
11941211 /**
1195- * Uses a uaer initialized JSONPointer and tries to
1196- * match it to an item whithin this JSONArray. For example, given a
1212+ * Uses a user initialized JSONPointer and tries to
1213+ * match it to an item within this JSONArray. For example, given a
11971214 * JSONArray initialized with this document:
11981215 * <pre>
11991216 * [
0 commit comments