Package se.datadosen.util
Class Scope
java.lang.Object
se.datadosen.util.Scope
- All Implemented Interfaces:
Serializable
,Map<String,
,Object> Bindings
- See Also:
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
clearboolean
containsKey
(Object key) containsKeyboolean
containsValue
(Object value) containsValueentrySet()
entrySetboolean
equalsflatten()
flatten2()
getMap()
getName()
getOuter()
getUnwrapped
(Object key) For best BeanShell experience we wrap and unwrap possibly primitive data typesint
hashCode()
Returns the hash code value for this map.boolean
isEmpty()
isEmptykeySet()
keySetProvide a way to name this scope for debugging purposesMake a new scope where the passed Map is put before (inner) the existing scope This scope is left untouched.void
putNotNull
(String key, Object value) Remove map from this scope or any outer scope Return this scope or outer scope if map == this scopevoid
int
size()
DOCUMENT ME!toString()
Display Scope hierarchy from this Scope to the root.values()
valuesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
outer
-
map
-
flattenCounter
public static int flattenCounter
-
-
Constructor Details
-
Scope
public Scope() -
Scope
-
Scope
-
Scope
-
-
Method Details
-
getName
-
name
Provide a way to name this scope for debugging purposes- Parameters:
name
-- Returns:
-
get
-
getUnwrapped
For best BeanShell experience we wrap and unwrap possibly primitive data types- Parameters:
key
-- Returns:
-
put
-
putNotNull
-
putAll
-
remove
-
getOuter
-
setOuter
-
getMap
-
flatten2
-
flatten
-
push
Make a new scope where the passed Map is put before (inner) the existing scope This scope is left untouched.- Parameters:
map
- Map to be added to the inner scope. If null, the existing scope will be used.- Returns:
-
remove
Remove map from this scope or any outer scope Return this scope or outer scope if map == this scope- Parameters:
map
-- Returns:
-
size
public int size()DOCUMENT ME! -
isEmpty
public boolean isEmpty()isEmpty -
containsKey
containsKey- Specified by:
containsKey
in interfaceBindings
- Specified by:
containsKey
in interfaceMap<String,
Object> - Parameters:
key
- Object- Returns:
- boolean
-
containsValue
containsValue- Specified by:
containsValue
in interfaceMap<String,
Object> - Parameters:
value
- Object- Returns:
- boolean
-
clear
public void clear()clear -
keySet
keySet -
values
values -
entrySet
entrySet -
equals
equals -
hashCode
public int hashCode()Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hash codes of each entry in the map'sentrySet()
view. This ensures thatt1.equals(t2)
implies thatt1.hashCode()==t2.hashCode()
for any two mapst1
andt2
, as required by the general contract of Object.hashCode.This implementation iterates over
entrySet()
, callinghashCode
on each element (entry) in the Collection, and adding up the results. -
toString
Display Scope hierarchy from this Scope to the root. Format: [Name @ identity: size] -> [Name @ identity: size] ...
-