org.eclipse.xtext.scoping.impl
Class MultimapBasedScope
java.lang.Object
org.eclipse.xtext.scoping.impl.AbstractScope
org.eclipse.xtext.scoping.impl.MultimapBasedScope
- All Implemented Interfaces:
- IScope
public class MultimapBasedScope
- extends AbstractScope
A scope implemented using a 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.
- Author:
- Sven Efftinge - Initial contribution and API, Sebastian Zarnekow
Methods inherited from class org.eclipse.xtext.scoping.impl.AbstractScope |
getAllElements, getElements, getElements, getLocalElementsByEObject, getParent, getParentElements, getSingleElement, getSingleElement, getSingleLocalElementByName, isIgnoreCase, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MultimapBasedScope
protected MultimapBasedScope(IScope parent,
com.google.common.collect.Multimap<QualifiedName,IEObjectDescription> elements,
boolean ignoreCase)
createScope
public static IScope createScope(IScope parent,
java.lang.Iterable<IEObjectDescription> descriptions,
boolean ignoreCase)
getAllLocalElements
protected java.lang.Iterable<IEObjectDescription> getAllLocalElements()
- Specified by:
getAllLocalElements
in class AbstractScope
getLocalElementsByName
protected java.lang.Iterable<IEObjectDescription> getLocalElementsByName(QualifiedName name)
- Overrides:
getLocalElementsByName
in class AbstractScope
isShadowed
protected boolean isShadowed(IEObjectDescription fromParent)
- Description copied from class:
AbstractScope
- Returns
true
if the given description input
from the parent scope is
shadowed by local elements.
- Overrides:
isShadowed
in class AbstractScope
- Returns:
true
if the given description input
from the parent scope is
shadowed by local elements.