Package g3.project.core
Class RecursiveBindings
- java.lang.Object
-
- javax.script.SimpleBindings
-
- g3.project.core.RecursiveBindings
-
- All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>
,javax.script.Bindings
public final class RecursiveBindings extends javax.script.SimpleBindings
Recursive bindings will search current bindings, then parent bindings, etc, etc, for the item.- Author:
- Group 3
-
-
Constructor Summary
Constructors Constructor Description RecursiveBindings()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.Object key)
java.lang.Object
get(java.lang.Object key)
java.util.Optional<RecursiveBindings>
getParent()
Get the optional parent bindings.boolean
localContainsKey(java.lang.Object key)
Do the local bindings contain the key?java.util.Optional<java.lang.Object>
localGet(java.lang.Object key)
Get key in local bindings.void
setParent(RecursiveBindings p)
Set parent bindings.-
Methods inherited from class javax.script.SimpleBindings
clear, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
-
-
-
-
Method Detail
-
setParent
public void setParent(RecursiveBindings p)
Set parent bindings.- Parameters:
p
- Parent bindings.
-
getParent
public java.util.Optional<RecursiveBindings> getParent()
Get the optional parent bindings.- Returns:
- Optional parent.
-
localContainsKey
public boolean localContainsKey(java.lang.Object key)
Do the local bindings contain the key?- Parameters:
key
- Key to find.- Returns:
- True if key is contained.
-
localGet
public java.util.Optional<java.lang.Object> localGet(java.lang.Object key)
Get key in local bindings.- Parameters:
key
- key to retrieve.- Returns:
- Optional object.
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejavax.script.Bindings
- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
containsKey
in classjavax.script.SimpleBindings
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interfacejavax.script.Bindings
- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
get
in classjavax.script.SimpleBindings
-
-