Class LightSelectableBasedScope

    • Constructor Detail

      • LightSelectableBasedScope

        protected LightSelectableBasedScope​(org.eclipse.xtext.scoping.IScope outer,
                                            org.eclipse.xtext.resource.ISelectable selectable,
                                            com.google.common.base.Predicate<org.eclipse.xtext.resource.IEObjectDescription> filter,
                                            org.eclipse.emf.ecore.EClass type,
                                            boolean ignoreCase,
                                            IIndexSlicePredicateService slicePredicateService)
        Constructor
        Parameters:
        outer - outer IScope, can't be null
        selectable - actual ISelectable for constructing scope, can't be null
        filter - special filter for scope, if filter instanceofAndPredicate index slices will be separated from filter. Can be null
        type - EClass of containing elements in the scope, can't be null
        ignoreCase - if true the resulting scope ia case-insensitive.
        slicePredicateService - IIndexSlicePredicateService for working with index slices, can't be null
    • Method Detail

      • createScope

        public static org.eclipse.xtext.scoping.IScope createScope​(org.eclipse.xtext.scoping.IScope outer,
                                                                   org.eclipse.xtext.resource.ISelectable selectable,
                                                                   org.eclipse.emf.ecore.EClass type,
                                                                   boolean ignoreCase,
                                                                   IIndexSlicePredicateService slicePredicateService)
        Constructor
        Parameters:
        outer - outer IScope, can't be null
        selectable - actual ISelectable for constructing scope, can't be null
        type - EClass of containing elements in the scope, can't be null
        ignoreCase - if true the resulting scope ia case-insensitive.
        slicePredicateService - IIndexSlicePredicateService for working with index slices, can't be null
      • createScope

        public static org.eclipse.xtext.scoping.IScope createScope​(org.eclipse.xtext.scoping.IScope outer,
                                                                   org.eclipse.xtext.resource.ISelectable selectable,
                                                                   com.google.common.base.Predicate<org.eclipse.xtext.resource.IEObjectDescription> filter,
                                                                   org.eclipse.emf.ecore.EClass type,
                                                                   boolean ignoreCase,
                                                                   IIndexSlicePredicateService slicePredicateService)
        Creates IScope from outer and selectable
        Parameters:
        outer - outer IScope, can't be null
        selectable - actual ISelectable for constructing scope, can't be null
        filter - special filter for scope, if filter instanceof AndPredicate index slices will be separated from filter. Can be null
        type - EClass of containing elements in the scope, can't be null
        ignoreCase - if true the resulting scope ia case-insensitive.
        slicePredicateService - IIndexSlicePredicateService for working with index slices, can't be null
      • getAllElements

        public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getAllElements()
        Specified by:
        getAllElements in interface org.eclipse.xtext.scoping.IScope
        Overrides:
        getAllElements in class LightAbstractScope
      • getSingleElement

        public org.eclipse.xtext.resource.IEObjectDescription getSingleElement​(org.eclipse.xtext.naming.QualifiedName name,
                                                                               Collection<ISliceFilter> slices)
        Description copied from interface: ISlicedScope
        Finds the first description that matches the given name.
        Specified by:
        getSingleElement in interface ISlicedScope
        Parameters:
        name - the name of the to-be-found element. May not be null.
        slices - list of predicates corresponding to the index slices, can't be null
        Returns:
        the first element that matches the name. May be null.
      • getElements

        public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements​(org.eclipse.xtext.naming.QualifiedName name,
                                                                                    Collection<ISliceFilter> slices)
        Description copied from interface: ISlicedScope
        Find all descriptions that match the given name.
        Specified by:
        getElements in interface ISlicedScope
        Parameters:
        name - the name of the to-be-found elements. May not be null.
        slices - list of predicates corresponding to the index slices, can't be null
        Returns:
        all elements that match the name. Never null.
      • getAllElements

        public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getAllElements​(Collection<ISliceFilter> slices)
        Description copied from interface: ISlicedScope
        Obtain all elements from the scope. Implementors a free to throw an UnsupportedOperationException if the scope cannot be enumerated.
        Specified by:
        getAllElements in interface ISlicedScope
        Parameters:
        slices - list of predicates corresponding to the index slices, can't be null
        Returns:
        all elements of the scope. Never null.
      • getElements

        public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements​(org.eclipse.emf.ecore.EObject object,
                                                                                    Collection<ISliceFilter> slices)
        Description copied from interface: ISlicedScope
        Finds all descriptions that match the given instance.
        Specified by:
        getElements in interface ISlicedScope
        Parameters:
        object - the instance whose descriptions should be obtained. May not be null.
        slices - list of predicates corresponding to the index slices, can't be null
        Returns:
        all elements that match the instance. Never null.
      • filterLocalElements

        protected Iterable<org.eclipse.xtext.resource.IEObjectDescription> filterLocalElements​(Iterable<org.eclipse.xtext.resource.IEObjectDescription> unfiltered)
        Filters all elements from unfiltered with {@link this#filter}
        Parameters:
        unfiltered - filtering elements, can't be null
        Returns:
        filtered elements, never null
      • getFilter

        protected com.google.common.base.Predicate<org.eclipse.xtext.resource.IEObjectDescription> getFilter()
        Gets actual filter scope. There is no index slices in it
        Returns:
        actual filter scope. There is no index slices in it. Can be null if filter wasn't set
      • getSelectable

        protected org.eclipse.xtext.resource.ISelectable getSelectable()
        Gets corresponding ISelectable for this scope
        Returns:
        corresponding ISelectable for this scope, never null