public class ModelQueriesGlobalConstraint extends java.lang.Object implements IGlobalConstraint
Modifier and Type | Field and Description |
---|---|
protected java.util.List<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> |
constraints |
static java.lang.String |
GLOBAL_CONSTRAINT |
protected java.util.List<ViatraQueryMatcher<? extends IPatternMatch>> |
matchers |
protected java.lang.String |
name |
protected ModelQueryType |
type |
Constructor and Description |
---|
ModelQueriesGlobalConstraint() |
ModelQueriesGlobalConstraint(java.util.List<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> constraints) |
ModelQueriesGlobalConstraint(java.lang.String name) |
ModelQueriesGlobalConstraint(java.lang.String name,
java.util.List<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> constraints) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkGlobalConstraint(ThreadContext context)
Checks whether the current state satisfies the global constraint.
|
IGlobalConstraint |
createNew()
Returns an instance of the
IGlobalConstraint . |
java.lang.String |
getName()
Returns the name of the global constraint.
|
void |
init(ThreadContext context)
Initializes the global constraint.
|
ModelQueriesGlobalConstraint |
withConstraint(IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> constraint)
Adds a new VIATRA Query pattern.
|
ModelQueriesGlobalConstraint |
withType(ModelQueryType type) |
public static final java.lang.String GLOBAL_CONSTRAINT
protected java.lang.String name
protected java.util.List<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> constraints
protected java.util.List<ViatraQueryMatcher<? extends IPatternMatch>> matchers
protected ModelQueryType type
public ModelQueriesGlobalConstraint(java.lang.String name, java.util.List<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> constraints)
public ModelQueriesGlobalConstraint(java.util.List<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> constraints)
public ModelQueriesGlobalConstraint(java.lang.String name)
public ModelQueriesGlobalConstraint()
public ModelQueriesGlobalConstraint withConstraint(IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> constraint)
constraint
- A VIATRA Query pattern.public ModelQueriesGlobalConstraint withType(ModelQueryType type)
public java.lang.String getName()
IGlobalConstraint
getName
in interface IGlobalConstraint
public boolean checkGlobalConstraint(ThreadContext context)
IGlobalConstraint
checkGlobalConstraint
in interface IGlobalConstraint
context
- The ThreadContext
which contains the necessary information.public void init(ThreadContext context)
IGlobalConstraint
init
in interface IGlobalConstraint
context
- The ThreadContext
.public IGlobalConstraint createNew()
IGlobalConstraint
IGlobalConstraint
. If it returns the same instance, all the methods has to be
thread save as they are called concurrently.createNew
in interface IGlobalConstraint