Class SurrogateQueryRegistry
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.matchers.context.surrogate.SurrogateQueryRegistry
-
public class SurrogateQueryRegistry extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IProvider<PQuery>
addDynamicSurrogateQueryForFeature(IInputKey feature, PQuery surrogateQuery)
IProvider<PQuery>
addDynamicSurrogateQueryForFeature(IInputKey feature, IProvider<PQuery> surrogateQuery)
java.util.Set<IInputKey>
getAllSurrogateQueries()
java.util.Set<IInputKey>
getDynamicSurrogateQueries()
java.util.Set<IInputKey>
getRegisteredSurrogateQueries()
PQuery
getSurrogateQuery(IInputKey feature)
boolean
hasSurrogateQueryFQN(IInputKey feature)
static SurrogateQueryRegistry
instance()
IProvider<PQuery>
registerSurrogateQueryForFeature(IInputKey feature, PQuery surrogateQuery)
IProvider<PQuery>
registerSurrogateQueryForFeature(IInputKey feature, IProvider<PQuery> surrogateQueryProvider)
IProvider<PQuery>
removeDynamicSurrogateQueryForFeature(IInputKey feature)
-
-
-
Method Detail
-
instance
public static SurrogateQueryRegistry instance()
-
registerSurrogateQueryForFeature
public IProvider<PQuery> registerSurrogateQueryForFeature(IInputKey feature, PQuery surrogateQuery)
- Parameters:
feature
-surrogateQuery
-- Returns:
- the previous surrogate query associated with feature, or null if there was no such query FQN registered
- Throws:
java.lang.IllegalArgumentException
- if feature or surrogateQuery is null
-
registerSurrogateQueryForFeature
public IProvider<PQuery> registerSurrogateQueryForFeature(IInputKey feature, IProvider<PQuery> surrogateQueryProvider)
- Parameters:
feature
-surrogateQuery
-- Returns:
- the previous surrogate query associated with feature, or null if there was no such query registered
- Throws:
java.lang.IllegalArgumentException
- if feature or surrogateQuery is null
-
addDynamicSurrogateQueryForFeature
public IProvider<PQuery> addDynamicSurrogateQueryForFeature(IInputKey feature, PQuery surrogateQuery)
-
addDynamicSurrogateQueryForFeature
public IProvider<PQuery> addDynamicSurrogateQueryForFeature(IInputKey feature, IProvider<PQuery> surrogateQuery)
-
removeDynamicSurrogateQueryForFeature
public IProvider<PQuery> removeDynamicSurrogateQueryForFeature(IInputKey feature)
-
hasSurrogateQueryFQN
public boolean hasSurrogateQueryFQN(IInputKey feature)
- Parameters:
feature
- that may have surrogate query defined, null not allowed- Returns:
- true if the feature has a surrogate query defined
- Throws:
java.lang.IllegalArgumentException
- if feature is null
-
getSurrogateQuery
public PQuery getSurrogateQuery(IInputKey feature)
- Parameters:
feature
- for which the surrogate query FQN should be returned- Returns:
- the surrogate query FQN defined for the feature
- Throws:
java.lang.IllegalArgumentException
- if feature is nulljava.util.NoSuchElementException
- if the feature has no surrogate query defined, usehasSurrogateQueryFQN(org.eclipse.viatra.query.runtime.matchers.context.IInputKey)
to check
-
getRegisteredSurrogateQueries
public java.util.Set<IInputKey> getRegisteredSurrogateQueries()
- Returns:
- an unmodifiable set of features with registered surrogate queries
-
getDynamicSurrogateQueries
public java.util.Set<IInputKey> getDynamicSurrogateQueries()
- Returns:
- an unmodifiable set of features with dynamically added surrogate queries
-
getAllSurrogateQueries
public java.util.Set<IInputKey> getAllSurrogateQueries()
- Returns:
- an unmodifiable set that contains all features with surrogate queries.
-
-