Permalink
Browse files

provide javadoc

  • Loading branch information...
1 parent f377bd4 commit 0ee0d4a24df68143608a5fe3a1f716aa6461b7f9 @ropalka ropalka committed Sep 19, 2012
@@ -25,73 +25,258 @@
import org.fossnova.json.stream.JsonWriter;
/**
+ * JSON array.
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ * @see JsonValue
+ * @see JsonValueFactory
*/
public interface JsonArray extends JsonValue, List< JsonValue > {
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#add(Object)} method.
+ * @param value string to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON string
+ */
boolean add( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#add(Object)} method.
+ * @param value number to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON number
+ */
boolean add( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#add(Object)} method.
+ * @param value boolean to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON boolean
+ */
boolean add( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#add(Object)} method.
+ * @param value JSON value
+ * @return <tt>true</tt> if this JSON array contained the specified JSON value
+ */
boolean add( final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#add(int, Object)} method.
+ * @param index index at which the specified JSON string is to be inserted
+ * @param value string to wrap
+ */
void add( final int index, final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#add(int, Object)} method.
+ * @param index index at which the specified JSON number is to be inserted
+ * @param value number to wrap
+ */
void add( final int index, final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#add(int, Object)} method.
+ * @param index index at which the specified JSON boolean is to be inserted
+ * @param value boolean to wrap
+ */
void add( final int index, final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#add(int, Object)} method.
+ * @param index index at which the specified JSON value is to be inserted
+ * @param value JSON value
+ */
void add( final int index, final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#contains(Object)} method.
+ * @param value string to wrap
+ * @return <tt>true</tt> if this JSON array contains the specified JSON string
+ */
boolean contains( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#contains(Object)} method.
+ * @param value number to wrap
+ * @return <tt>true</tt> if this JSON array contains the specified JSON number
+ */
boolean contains( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#contains(Object)} method.
+ * @param value boolean to wrap
+ * @return <tt>true</tt> if this JSON array contains the specified JSON boolean
+ */
boolean contains( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#contains(Object)} method.
+ * @param value JSON value
+ * @return <tt>true</tt> if this JSON array contains the specified JSON value
+ */
boolean contains( final JsonValue value );
- boolean contains( final Object value );
-
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#indexOf(Object)} method.
+ * @param value string to wrap
+ * @return the index of the first occurrence of the specified JSON string in
+ * this JSON array, or -1 if this JSON array does not contain the JSON string
+ */
int indexOf( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#indexOf(Object)} method.
+ * @param value number to wrap
+ * @return the index of the first occurrence of the specified JSON number in
+ * this JSON array, or -1 if this JSON array does not contain the JSON number
+ */
int indexOf( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#indexOf(Object)} method.
+ * @param value boolean to wrap
+ * @return the index of the first occurrence of the specified JSON boolean in
+ * this JSON array, or -1 if this JSON array does not contain the JSON boolean
+ */
int indexOf( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#indexOf(Object)} method.
+ * @param value JSON value
+ * @return the index of the first occurrence of the specified JSON value in
+ * this JSON array, or -1 if this JSON array does not contain the JSON value
+ */
int indexOf( final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#lastIndexOf(Object)} method.
+ * @param value string to wrap
+ * @return he index of the last occurrence of the specified JSON string in
+ * this JSON array, or -1 if this JSON array does not contain the JSON string
+ */
int lastIndexOf( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#lastIndexOf(Object)} method.
+ * @param value string to wrap
+ * @return he index of the last occurrence of the specified JSON number in
+ * this JSON array, or -1 if this JSON array does not contain the JSON number
+ */
int lastIndexOf( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#lastIndexOf(Object)} method.
+ * @param value string to wrap
+ * @return he index of the last occurrence of the specified JSON boolean in
+ * this JSON array, or -1 if this JSON array does not contain the JSON boolean
+ */
int lastIndexOf( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#lastIndexOf(Object)} method.
+ * @param value JSON value
+ * @return he index of the last occurrence of the specified JSON value in
+ * this JSON array, or -1 if this JSON array does not contain the JSON value
+ */
int lastIndexOf( final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#remove(Object)} method.
+ * @param value string to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON string
+ */
boolean remove( final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#remove(Object)} method.
+ * @param value number to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON number
+ */
boolean remove( final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#remove(Object)} method.
+ * @param value boolean to wrap
+ * @return <tt>true</tt> if this JSON array contained the specified JSON boolean
+ */
boolean remove( final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#remove(Object)} method.
+ * @param value JSON value
+ * @return <tt>true</tt> if this JSON array contained the specified JSON value
+ */
boolean remove( final JsonValue value );
+ /**
+ * Wraps passed value with JsonString and delegates the call to
+ * {@link java.util.List#set(int, Object)} method.
+ * @param index index of the JSON value to replace
+ * @param value string to wrap
+ * @return the JSON value previously held at the specified position
+ */
JsonValue set( final int index, final String value );
+ /**
+ * Wraps passed value with JsonNumber and delegates the call to
+ * {@link java.util.List#set(int, Object)} method.
+ * @param index index of the JSON value to replace
+ * @param value number to wrap
+ * @return the JSON value previously held at the specified position
+ */
JsonValue set( final int index, final Number value );
+ /**
+ * Wraps passed value with JsonBoolean and delegates the call to
+ * {@link java.util.List#set(int, Object)} method.
+ * @param index index of the JSON value to replace
+ * @param value boolean to wrap
+ * @return the JSON value previously held at the specified position
+ */
JsonValue set( final int index, final Boolean value );
+ /**
+ * Delegates the call to {@link java.util.List#set(int, Object)} method.
+ * @param index index of the JSON value to replace
+ * @param value JSON value
+ * @return the JSON value previously held at the specified position
+ */
JsonValue set( final int index, final JsonValue value );
- JsonArray subList( final int fromIndex, final int toIndex );
-
+ /**
+ * Translates this JSON array to Java array.
+ * @return java array
+ */
JsonValue[] toArray();
+ /**
+ * Serializes this JSON array to the writer.
+ * @param writer to write to
+ * @throws IOException if some I/O error occurs.
+ */
void writeTo( JsonWriter writer ) throws IOException;
+ /**
+ * Clones this JSON array.
+ * @return new JSON array clone.
+ */
JsonArray clone();
}
@@ -20,13 +20,28 @@
package org.fossnova.json;
/**
+ * JSON boolean.
* @author <a href="mailto:opalka dot richard at gmail dot com">Richard Opalka</a>
+ * @see JsonValue
+ * @see JsonValueFactory
*/
public interface JsonBoolean extends JsonValue {
- void setBoolean( boolean b );
+ /**
+ * Sets new boolean value.
+ * @param value new boolean value
+ */
+ void setBoolean( boolean value );
+ /**
+ * Gets boolean value.
+ * @return boolean value
+ */
boolean getBoolean();
+ /**
+ * Clones this JSON boolean.
+ * @return new JSON boolean clone.
+ */
JsonBoolean clone();
}
Oops, something went wrong.

0 comments on commit 0ee0d4a

Please sign in to comment.