Package org.eclipse.xtext.scoping.impl
Class FilteringScope
- java.lang.Object
-
- org.eclipse.xtext.scoping.impl.FilteringScope
-
- All Implemented Interfaces:
IScope
public class FilteringScope extends java.lang.Object implements IScope
A FilteringScope filters out allIEObjectDescriptionfor which the given predicate returnsfalse.
-
-
Constructor Summary
Constructors Constructor Description FilteringScope(IScope delegate, com.google.common.base.Predicate<IEObjectDescription> filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<IEObjectDescription>getAllElements()Obtain all elements from the scope.java.lang.Iterable<IEObjectDescription>getElements(org.eclipse.emf.ecore.EObject object)Find all descriptions that match the given instance.java.lang.Iterable<IEObjectDescription>getElements(QualifiedName name)Find all descriptions that match the given name.protected IEObjectDescriptiongetFirst(java.lang.Iterable<IEObjectDescription> elements)IEObjectDescriptiongetSingleElement(org.eclipse.emf.ecore.EObject object)Find the first description that matches the given instance.IEObjectDescriptiongetSingleElement(QualifiedName name)Find the first description that matches the given name.
-
-
-
Constructor Detail
-
FilteringScope
public FilteringScope(IScope delegate, com.google.common.base.Predicate<IEObjectDescription> filter)
-
-
Method Detail
-
getAllElements
public java.lang.Iterable<IEObjectDescription> getAllElements()
Description copied from interface:IScopeObtain all elements from the scope. Implementors a free to throw anUnsupportedOperationExceptionif the scope cannot be enumerated.- Specified by:
getAllElementsin interfaceIScope- Returns:
- all elements of the scope. Never
null.
-
getElements
public java.lang.Iterable<IEObjectDescription> getElements(org.eclipse.emf.ecore.EObject object)
Description copied from interface:IScopeFind all descriptions that match the given instance.- Specified by:
getElementsin interfaceIScope- Parameters:
object- the instance whose descriptions should be obtained. May not benull.- Returns:
- all elements that match the
instance. Nevernull.
-
getElements
public java.lang.Iterable<IEObjectDescription> getElements(QualifiedName name)
Description copied from interface:IScopeFind all descriptions that match the given name.- Specified by:
getElementsin interfaceIScope- Parameters:
name- the name of the to-be-found elements. May not benull.- Returns:
- all elements that match the
name. Nevernull.
-
getSingleElement
public IEObjectDescription getSingleElement(org.eclipse.emf.ecore.EObject object)
Description copied from interface:IScopeFind the first description that matches the given instance.- Specified by:
getSingleElementin interfaceIScope- Parameters:
object- the instance whose description should be obtained. May not benull.- Returns:
- the first element that matches the
instance. May benull.
-
getSingleElement
public IEObjectDescription getSingleElement(QualifiedName name)
Description copied from interface:IScopeFind the first description that matches the given name.- Specified by:
getSingleElementin interfaceIScope- Parameters:
name- the name of the to-be-found element. May not benull.- Returns:
- the first element that matches the
name. May benull.
-
getFirst
protected IEObjectDescription getFirst(java.lang.Iterable<IEObjectDescription> elements)
-
-