Class ScriptableLinkedHashMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<K,V>
-
- org.springframework.extensions.webscripts.ScriptableLinkedHashMap<K,V>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<K,V>,org.mozilla.javascript.Scriptable,ScriptableMap<K,V>
public class ScriptableLinkedHashMap<K,V> extends java.util.LinkedHashMap<K,V> implements ScriptableMap<K,V>
Implementation of a Scriptable Map. This is the best choice for maps that want to represent JavaScript associative arrays - allowing access via key and integer index. It maintains and respects insertion order of the elements and allows either string or integer keys.- Author:
- Kevin Roast
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ScriptableLinkedHashMap()ScriptableLinkedHashMap(int initialCapacity)ScriptableLinkedHashMap(java.util.Map<K,V> source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(int index)voiddelete(java.lang.String name)java.lang.Objectget(int index, org.mozilla.javascript.Scriptable start)java.lang.Objectget(java.lang.String name, org.mozilla.javascript.Scriptable start)java.lang.StringgetClassName()java.lang.ObjectgetDefaultValue(java.lang.Class hint)java.lang.Object[]getIds()org.mozilla.javascript.ScriptablegetParentScope()org.mozilla.javascript.ScriptablegetPrototype()booleanhas(int index, org.mozilla.javascript.Scriptable start)booleanhas(java.lang.String name, org.mozilla.javascript.Scriptable start)booleanhasInstance(org.mozilla.javascript.Scriptable instance)voidput(int index, org.mozilla.javascript.Scriptable start, java.lang.Object value)voidput(java.lang.String name, org.mozilla.javascript.Scriptable start, java.lang.Object value)voidsetParentScope(org.mozilla.javascript.Scriptable parent)voidsetPrototype(org.mozilla.javascript.Scriptable prototype)-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
-
-
-
Method Detail
-
getClassName
public java.lang.String getClassName()
- Specified by:
getClassNamein interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.getClassName()
-
get
public java.lang.Object get(java.lang.String name, org.mozilla.javascript.Scriptable start)- Specified by:
getin interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.get(java.lang.String, org.mozilla.javascript.Scriptable)
-
get
public java.lang.Object get(int index, org.mozilla.javascript.Scriptable start)- Specified by:
getin interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.get(int, org.mozilla.javascript.Scriptable)
-
has
public boolean has(java.lang.String name, org.mozilla.javascript.Scriptable start)- Specified by:
hasin interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.has(java.lang.String, org.mozilla.javascript.Scriptable)
-
has
public boolean has(int index, org.mozilla.javascript.Scriptable start)- Specified by:
hasin interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.has(int, org.mozilla.javascript.Scriptable)
-
put
public void put(java.lang.String name, org.mozilla.javascript.Scriptable start, java.lang.Object value)- Specified by:
putin interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.put(java.lang.String, org.mozilla.javascript.Scriptable, java.lang.Object)
-
put
public void put(int index, org.mozilla.javascript.Scriptable start, java.lang.Object value)- Specified by:
putin interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.put(int, org.mozilla.javascript.Scriptable, java.lang.Object)
-
delete
public void delete(java.lang.String name)
- Specified by:
deletein interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.delete(java.lang.String)
-
delete
public void delete(int index)
- Specified by:
deletein interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.delete(int)
-
getPrototype
public org.mozilla.javascript.Scriptable getPrototype()
- Specified by:
getPrototypein interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.getPrototype()
-
setPrototype
public void setPrototype(org.mozilla.javascript.Scriptable prototype)
- Specified by:
setPrototypein interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.setPrototype(org.mozilla.javascript.Scriptable)
-
getParentScope
public org.mozilla.javascript.Scriptable getParentScope()
- Specified by:
getParentScopein interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.getParentScope()
-
setParentScope
public void setParentScope(org.mozilla.javascript.Scriptable parent)
- Specified by:
setParentScopein interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.setParentScope(org.mozilla.javascript.Scriptable)
-
getIds
public java.lang.Object[] getIds()
- Specified by:
getIdsin interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.getIds()
-
getDefaultValue
public java.lang.Object getDefaultValue(java.lang.Class hint)
- Specified by:
getDefaultValuein interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.getDefaultValue(java.lang.Class)
-
hasInstance
public boolean hasInstance(org.mozilla.javascript.Scriptable instance)
- Specified by:
hasInstancein interfaceorg.mozilla.javascript.Scriptable- See Also:
Scriptable.hasInstance(org.mozilla.javascript.Scriptable)
-
-