public class MultimapBasedScope extends AbstractScope
Multimap
.
This implementation assumes, that the keys of the Multimap
are the keys of the contained EObjectDescription
s
as well as the name.
When looking up elements using AbstractScope.getElements(QualifiedName)
this implementation looks up the the elements from the map, hence are much
more efficient for many IEObjectDescription
s.AbstractScope.ParentIterable
Modifier | Constructor and Description |
---|---|
protected |
MultimapBasedScope(IScope parent,
com.google.common.collect.Multimap<QualifiedName,IEObjectDescription> elements,
boolean ignoreCase) |
Modifier and Type | Method and Description |
---|---|
static IScope |
createScope(IScope parent,
java.lang.Iterable<IEObjectDescription> descriptions,
boolean ignoreCase) |
protected java.lang.Iterable<IEObjectDescription> |
getAllLocalElements() |
protected java.lang.Iterable<IEObjectDescription> |
getLocalElementsByName(QualifiedName name) |
protected boolean |
isShadowed(IEObjectDescription fromParent)
Returns
true if the given description input from the parent scope is
shadowed by local elements. |
getAllElements, getElements, getElements, getLocalElementsByEObject, getParent, getParentElements, getSingleElement, getSingleElement, getSingleLocalElementByName, isIgnoreCase, toString
protected MultimapBasedScope(IScope parent, com.google.common.collect.Multimap<QualifiedName,IEObjectDescription> elements, boolean ignoreCase)
public static IScope createScope(IScope parent, java.lang.Iterable<IEObjectDescription> descriptions, boolean ignoreCase)
protected java.lang.Iterable<IEObjectDescription> getAllLocalElements()
getAllLocalElements
in class AbstractScope
protected java.lang.Iterable<IEObjectDescription> getLocalElementsByName(QualifiedName name)
getLocalElementsByName
in class AbstractScope
protected boolean isShadowed(IEObjectDescription fromParent)
AbstractScope
true
if the given description input
from the parent scope is
shadowed by local elements.isShadowed
in class AbstractScope
true
if the given description input
from the parent scope is
shadowed by local elements.