Package nxt.addons
Class JA
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList
-
- nxt.addons.JA
-
- All Implemented Interfaces:
java.lang.Iterable
,java.util.Collection
,java.util.List
public class JA extends java.util.AbstractList
Delegate json array operations to json simple and wrap it with convenience methods This class does not really keep a list, but it implements a list in order to delegate iteration to the underlying JSONArray in order to support streaming into String.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(JO jo)
boolean
addAllJO(java.util.Collection<JO> c)
JO
get(int i)
java.lang.Object
getObject(int i)
java.util.Iterator<JO>
iterator()
java.util.ListIterator
listIterator()
Required by JSON#encodeArray()java.util.List<JO>
objects()
static JA
parse(java.io.Reader r)
static JA
parse(java.lang.String s)
int
size()
org.json.simple.JSONArray
toJSONArray()
java.util.List<java.lang.String>
values()
-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Method Detail
-
toJSONArray
public org.json.simple.JSONArray toJSONArray()
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection
- Specified by:
size
in interfacejava.util.List
- Specified by:
size
in classjava.util.AbstractCollection
-
iterator
public java.util.Iterator<JO> iterator()
- Specified by:
iterator
in interfacejava.util.Collection
- Specified by:
iterator
in interfacejava.lang.Iterable
- Specified by:
iterator
in interfacejava.util.List
- Overrides:
iterator
in classjava.util.AbstractList
-
values
public java.util.List<java.lang.String> values()
-
objects
public java.util.List<JO> objects()
-
add
public boolean add(JO jo)
-
get
public JO get(int i)
- Specified by:
get
in interfacejava.util.List
- Specified by:
get
in classjava.util.AbstractList
-
getObject
public java.lang.Object getObject(int i)
-
listIterator
public java.util.ListIterator listIterator()
Required by JSON#encodeArray()- Specified by:
listIterator
in interfacejava.util.List
- Overrides:
listIterator
in classjava.util.AbstractList
- Returns:
- iterator
-
parse
public static JA parse(java.lang.String s)
-
parse
public static JA parse(java.io.Reader r)
-
addAllJO
public boolean addAllJO(java.util.Collection<JO> c)
-
-