Package jetbrains.mps.scope
Class ConditionalScope
- java.lang.Object
 - 
- jetbrains.mps.smodel.BaseScope
 - 
- jetbrains.mps.project.FilteredScope
 - 
- jetbrains.mps.scope.ConditionalScope
 
 
 
 
- 
- All Implemented Interfaces:
 SearchScope
public final class ConditionalScope extends FilteredScope
Scopefiltered with conditions. XXX perhaps, shall root at BaseScope instead of FilteredScope as with Java8 filtering is easy to accomplish with streams and predicates. The only obstacle is that it's not handy to use predicates from MPS (could not use method references nor invoke Predicate's defaults to construct compound) Perhaps, could extend Predicate in Condition, with default test() implementation to facilitate migration?- Since:
 - 3.4
 
 
- 
- 
Field Summary
- 
Fields inherited from class jetbrains.mps.project.FilteredScope
myScope 
 - 
 
- 
Constructor Summary
Constructors Constructor Description ConditionalScope(SearchScope scope, Condition<SModule> moduleCondition, Condition<SModel> modelCondition) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanacceptModel(SModel model)protected booleanacceptModule(SModule module)- 
Methods inherited from class jetbrains.mps.project.FilteredScope
getModels, getModules, resolve, resolve 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface org.jetbrains.mps.openapi.module.SearchScope
resolve 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
ConditionalScope
public ConditionalScope(@NotNull SearchScope scope, @Nullable Condition<SModule> moduleCondition, @Nullable Condition<SModel> modelCondition)
- Parameters:
 scope- scope to filter with conditions, mandatory.moduleCondition- optional condition for modules of the scope to match, any module matches if unspecified.modelCondition- optional condition for models of the scope to match, any model matches if unspecified.
 
 - 
 
- 
Method Detail
- 
acceptModule
protected boolean acceptModule(SModule module)
- Specified by:
 acceptModulein classFilteredScope
 
- 
acceptModel
protected boolean acceptModel(SModel model)
- Specified by:
 acceptModelin classFilteredScope
 
 - 
 
 -