public class MapBasedScope extends AbstractScope
Map used for efficient lookup of ordinary named
EObjectDescriptions.
This implementation assumes, that the keys of the Map correspond to the keys of the contained EObjectDescription.
Additionally it assumes, that those keys are equal to description.getName().toLowerCase().
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 IEObjectDescriptions.AbstractScope.ParentIterable| Modifier | Constructor and Description |
|---|---|
protected |
MapBasedScope(IScope parent,
Map<QualifiedName,IEObjectDescription> elements,
boolean ignoreCase) |
| Modifier and Type | Method and Description |
|---|---|
static IScope |
createScope(IScope parent,
Collection<IEObjectDescription> descriptions) |
static IScope |
createScope(IScope parent,
Iterable<IEObjectDescription> descriptions) |
static IScope |
createScope(IScope parent,
Iterable<IEObjectDescription> descriptions,
boolean ignoreCase) |
protected Iterable<IEObjectDescription> |
getAllLocalElements() |
protected 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, toStringprotected MapBasedScope(IScope parent, Map<QualifiedName,IEObjectDescription> elements, boolean ignoreCase)
public static IScope createScope(IScope parent, Iterable<IEObjectDescription> descriptions, boolean ignoreCase)
public static IScope createScope(IScope parent, Collection<IEObjectDescription> descriptions)
public static IScope createScope(IScope parent, Iterable<IEObjectDescription> descriptions)
protected Iterable<IEObjectDescription> getAllLocalElements()
getAllLocalElements in class AbstractScopeprotected Iterable<IEObjectDescription> getLocalElementsByName(QualifiedName name)
getLocalElementsByName in class AbstractScopeprotected boolean isShadowed(IEObjectDescription fromParent)
AbstractScopetrue if the given description input from the parent scope is
shadowed by local elements.isShadowed in class AbstractScopetrue if the given description input from the parent scope is
shadowed by local elements.Copyright © 2015. All Rights Reserved.