Package org.zkoss.chart.util
Class OptionsList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<Object>
-
- org.zkoss.chart.util.OptionsList<E>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Object>
,Collection<Object>
,Deque<Object>
,List<Object>
,Queue<Object>
,org.zkoss.json.JSONAware
public class OptionsList<E> extends LinkedList<Object> implements org.zkoss.json.JSONAware
An options list helper.- Author:
- jumperchen
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description OptionsList()
Constructs an empty list.OptionsList(Collection<? extends E> c)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OptionsList<Object>
addNestedList(Object... values)
Adds to create a nested options list with the given values.OptionsMap<String,Object>
addNestedMap(Object... pairs)
Adds to create a nested options map with the given key and value pairs.OptionsList<E>
append(Object value)
Adds the value into the list.org.zkoss.json.JSONAware
getParent()
Returns the parent options eitherOptionsMap
orOptionsList
.String
toJSONString()
static String
toJSONString(Collection collection)
String
toString()
Encodes this object to a JSON string.-
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
-
Methods inherited from class java.util.AbstractSequentialList
iterator
-
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
-
-
-
Constructor Detail
-
OptionsList
public OptionsList()
Constructs an empty list.
-
OptionsList
public OptionsList(Collection<? extends E> c)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.- Parameters:
c
- the collection whose elements are to be placed into this list- Throws:
NullPointerException
- if the specified collection is null
-
-
Method Detail
-
getParent
public org.zkoss.json.JSONAware getParent()
Returns the parent options eitherOptionsMap
orOptionsList
. If null, that means the option is root object.
-
append
public OptionsList<E> append(Object value)
Adds the value into the list.- Returns:
- the instance itself.
-
addNestedList
public OptionsList<Object> addNestedList(Object... values)
Adds to create a nested options list with the given values.- Returns:
- a nested options list
-
addNestedMap
public OptionsMap<String,Object> addNestedMap(Object... pairs)
Adds to create a nested options map with the given key and value pairs.- Returns:
- a nested options map
-
toJSONString
public String toJSONString()
- Specified by:
toJSONString
in interfaceorg.zkoss.json.JSONAware
-
toString
public String toString()
Encodes this object to a JSON string. It is the same astoJSONString()
.- Overrides:
toString
in classAbstractCollection<Object>
-
toJSONString
public static String toJSONString(Collection collection)
-
-