Class CachedLightSimpleScope
- java.lang.Object
-
- com._1c.g5.modeling.xtext.scoping.LightAbstractScope
-
- com._1c.g5.modeling.xtext.scoping.LightSimpleScope
-
- com._1c.g5.modeling.xtext.scoping.CachedLightSimpleScope
-
- All Implemented Interfaces:
ISlicedScope,org.eclipse.xtext.scoping.IScope
- Direct Known Subclasses:
PlatformSimpleScope
public class CachedLightSimpleScope extends LightSimpleScope implements ISlicedScope
Lightweight and cached implementation of the SimpleScope.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com._1c.g5.modeling.xtext.scoping.LightAbstractScope
LightAbstractScope.EObjectFilterPredicate, LightAbstractScope.ParentIterable
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Integer>allElementsByNameprotected org.eclipse.xtext.resource.IEObjectDescription[]elementsprotected IIndexSlicesManagersliceManager-
Fields inherited from class com._1c.g5.modeling.xtext.scoping.LightSimpleScope
descriptions
-
Fields inherited from interface com._1c.g5.modeling.xtext.scoping.ISlicedScope
NULLSCOPE
-
-
Constructor Summary
Constructors Constructor Description CachedLightSimpleScope(Iterable<org.eclipse.xtext.resource.IEObjectDescription> descriptions, boolean ignoreCase, Collection<ISliceFilter> predicatesForSlices)ConstructorCachedLightSimpleScope(org.eclipse.xtext.scoping.IScope parent, Iterable<org.eclipse.xtext.resource.IEObjectDescription> descriptions, boolean ignoreCase, Collection<ISliceFilter> predicatesForSlices)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<org.eclipse.xtext.resource.IEObjectDescription>getAllElements()Iterable<org.eclipse.xtext.resource.IEObjectDescription>getAllElements(Collection<ISliceFilter> slices)Obtain all elements from the scope.Iterable<org.eclipse.xtext.resource.IEObjectDescription>getElements(org.eclipse.emf.ecore.EObject object, Collection<ISliceFilter> slices)Finds all descriptions that match the given instance.Iterable<org.eclipse.xtext.resource.IEObjectDescription>getElements(org.eclipse.xtext.naming.QualifiedName name)Iterable<org.eclipse.xtext.resource.IEObjectDescription>getElements(org.eclipse.xtext.naming.QualifiedName name, Collection<ISliceFilter> slices)Find all descriptions that match the given name.org.eclipse.xtext.resource.IEObjectDescriptiongetSingleElement(org.eclipse.xtext.naming.QualifiedName name)org.eclipse.xtext.resource.IEObjectDescriptiongetSingleElement(org.eclipse.xtext.naming.QualifiedName name, Collection<ISliceFilter> slices)Finds the first description that matches the given name.protected org.eclipse.xtext.resource.IEObjectDescriptiongetSingleLocalElementByName(org.eclipse.xtext.naming.QualifiedName name)protected booleanisShadowed(org.eclipse.xtext.resource.IEObjectDescription fromParent)Returnstrueif the given descriptioninputfrom the parent scope is shadowed by local elements.-
Methods inherited from class com._1c.g5.modeling.xtext.scoping.LightSimpleScope
getAllLocalElements, getLocalElementsByEObject, getLocalElementsByName, getShadowingKey
-
Methods inherited from class com._1c.g5.modeling.xtext.scoping.LightAbstractScope
getElements, getParent, getParentElements, getSingleElement, isIgnoreCase, toString
-
-
-
-
Field Detail
-
elements
protected org.eclipse.xtext.resource.IEObjectDescription[] elements
-
sliceManager
protected IIndexSlicesManager sliceManager
-
-
Constructor Detail
-
CachedLightSimpleScope
public CachedLightSimpleScope(org.eclipse.xtext.scoping.IScope parent, Iterable<org.eclipse.xtext.resource.IEObjectDescription> descriptions, boolean ignoreCase, Collection<ISliceFilter> predicatesForSlices)Constructor- Parameters:
parent- parent scope, can't benulldescriptions-IEObjectDescriptions for creating scope, can't benullignoreCase-trueif it's insensitive scope,falseotherwisepredicatesForSlices- collection ofISliceFilterdefining slices of index elements, can't benull
-
CachedLightSimpleScope
public CachedLightSimpleScope(Iterable<org.eclipse.xtext.resource.IEObjectDescription> descriptions, boolean ignoreCase, Collection<ISliceFilter> predicatesForSlices)
Constructor- Parameters:
descriptions- all elements contained in scope, can't benullignoreCase- whether name lookup and shadowing should be case insensitive or not.predicatesForSlices- collection ofISliceFilterdefining slices of index elements, can't benull
-
-
Method Detail
-
getSingleElement
public org.eclipse.xtext.resource.IEObjectDescription getSingleElement(org.eclipse.xtext.naming.QualifiedName name, Collection<ISliceFilter> slices)Description copied from interface:ISlicedScopeFinds the first description that matches the given name.- Specified by:
getSingleElementin interfaceISlicedScope- Parameters:
name- the name of the to-be-found element. May not benull.slices- list of predicates corresponding to the index slices, can't benull- Returns:
- the first element that matches the
name. May benull.
-
getSingleElement
public org.eclipse.xtext.resource.IEObjectDescription getSingleElement(org.eclipse.xtext.naming.QualifiedName name)
- Specified by:
getSingleElementin interfaceorg.eclipse.xtext.scoping.IScope- Overrides:
getSingleElementin classLightAbstractScope
-
getElements
public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements(org.eclipse.xtext.naming.QualifiedName name, Collection<ISliceFilter> slices)
Description copied from interface:ISlicedScopeFind all descriptions that match the given name.- Specified by:
getElementsin interfaceISlicedScope- Parameters:
name- the name of the to-be-found elements. May not benull.slices- list of predicates corresponding to the index slices, can't benull- Returns:
- all elements that match the
name. Nevernull.
-
getElements
public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements(org.eclipse.xtext.naming.QualifiedName name)
- Specified by:
getElementsin interfaceorg.eclipse.xtext.scoping.IScope- Overrides:
getElementsin classLightAbstractScope
-
getAllElements
public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getAllElements(Collection<ISliceFilter> slices)
Description copied from interface:ISlicedScopeObtain all elements from the scope. Implementors a free to throw anUnsupportedOperationExceptionif the scope cannot be enumerated.- Specified by:
getAllElementsin interfaceISlicedScope- Parameters:
slices- list of predicates corresponding to the index slices, can't benull- Returns:
- all elements of the scope. Never
null.
-
getAllElements
public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getAllElements()
- Specified by:
getAllElementsin interfaceorg.eclipse.xtext.scoping.IScope- Overrides:
getAllElementsin classLightAbstractScope
-
getElements
public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements(org.eclipse.emf.ecore.EObject object, Collection<ISliceFilter> slices)
Description copied from interface:ISlicedScopeFinds all descriptions that match the given instance.- Specified by:
getElementsin interfaceISlicedScope- Parameters:
object- the instance whose descriptions should be obtained. May not benull.slices- list of predicates corresponding to the index slices, can't benull- Returns:
- all elements that match the
instance. Nevernull.
-
getSingleLocalElementByName
protected org.eclipse.xtext.resource.IEObjectDescription getSingleLocalElementByName(org.eclipse.xtext.naming.QualifiedName name)
- Overrides:
getSingleLocalElementByNamein classLightSimpleScope
-
isShadowed
protected boolean isShadowed(org.eclipse.xtext.resource.IEObjectDescription fromParent)
Description copied from class:LightAbstractScopeReturnstrueif the given descriptioninputfrom the parent scope is shadowed by local elements.- Overrides:
isShadowedin classLightAbstractScope- Returns:
trueif the given descriptioninputfrom the parent scope is shadowed by local elements.
-
-