Package org.apache.solr.common.util
Class SimpleOrderedMap<T>
- java.lang.Object
-
- org.apache.solr.common.util.NamedList<T>
-
- org.apache.solr.common.util.SimpleOrderedMap<T>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Map.Entry<String,T>>
,SimpleMap<T>
,MapSerializable
,MapWriter
,NavigableObject
,org.noggit.JSONWriter.Writable
public class SimpleOrderedMap<T> extends NamedList<T>
SimpleOrderedMap
is aNamedList
where access by key is more important than maintaining order when it comes to representing the held data in other forms, as ResponseWriters normally do. It's normally not a good idea to repeat keys or use null keys, but this is not enforced. If key uniqueness enforcement is desired, use a regularMap
.For example, a JSON response writer may choose to write a SimpleOrderedMap as {"foo":10,"bar":20} and may choose to write a NamedList as ["foo",10,"bar",20]. An XML response writer may choose to render both the same way.
This class does not provide efficient lookup by key, its main purpose is to hold data to be serialized. It aims to minimize overhead and to be efficient at adding new elements.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.common.util.NamedList
NamedList.NamedListEntry<T>
-
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
MapWriter.EntryWriter
-
-
Constructor Summary
Constructors Constructor Description SimpleOrderedMap()
Creates an empty instanceSimpleOrderedMap(int sz)
SimpleOrderedMap(Map.Entry<String,T>[] nameValuePairs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleOrderedMap<T>
clone()
Makes a shallow copy of the named list.-
Methods inherited from class org.apache.solr.common.util.NamedList
_size, abortableForEach, abortableForEachKey, add, addAll, addAll, asMap, asShallowMap, asShallowMap, clear, equals, findRecursive, forEach, forEachEntry, forEachKey, get, get, getAll, getBooleanArg, getImmutableCopy, getName, getVal, hashCode, indexOf, iterator, remove, remove, removeAll, removeBooleanArg, removeConfigArgs, setName, setVal, size, toSolrParams, toString, writeMap
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr
-
-