Package 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 aMultimap. This implementation assumes, that the keys of theMultimapare the keys of the containedEObjectDescriptions as well as the name. When looking up elements usingAbstractScope.getElements(QualifiedName)this implementation looks up the elements from the map, hence are much more efficient for manyIEObjectDescriptions.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.xtext.scoping.impl.AbstractScope
AbstractScope.ParentIterable
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMultimapBasedScope(IScope parent, com.google.common.collect.Multimap<QualifiedName,IEObjectDescription> elements, boolean ignoreCase)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IScopecreateScope(IScope parent, java.lang.Iterable<IEObjectDescription> descriptions, boolean ignoreCase)protected java.lang.Iterable<IEObjectDescription>getAllLocalElements()protected java.lang.Iterable<IEObjectDescription>getLocalElementsByName(QualifiedName name)protected booleanisShadowed(IEObjectDescription fromParent)Returnstrueif the given descriptioninputfrom the parent scope is shadowed by local elements.-
Methods inherited from class org.eclipse.xtext.scoping.impl.AbstractScope
getAllElements, getElements, getElements, getLocalElementsByEObject, getParent, getParentElements, getSingleElement, getSingleElement, getSingleLocalElementByName, isIgnoreCase, toString
-
-
-
-
Constructor Detail
-
MultimapBasedScope
protected MultimapBasedScope(IScope parent, com.google.common.collect.Multimap<QualifiedName,IEObjectDescription> elements, boolean ignoreCase)
-
-
Method Detail
-
createScope
public static IScope createScope(IScope parent, java.lang.Iterable<IEObjectDescription> descriptions, boolean ignoreCase)
-
getAllLocalElements
protected java.lang.Iterable<IEObjectDescription> getAllLocalElements()
- Specified by:
getAllLocalElementsin classAbstractScope
-
getLocalElementsByName
protected java.lang.Iterable<IEObjectDescription> getLocalElementsByName(QualifiedName name)
- Overrides:
getLocalElementsByNamein classAbstractScope
-
isShadowed
protected boolean isShadowed(IEObjectDescription fromParent)
Description copied from class:AbstractScopeReturnstrueif the given descriptioninputfrom the parent scope is shadowed by local elements.- Overrides:
isShadowedin classAbstractScope- Returns:
trueif the given descriptioninputfrom the parent scope is shadowed by local elements.
-
-