@Vetoed public class Variables extends Object
Iteration and
RuleSubset.| Modifier and Type | Field and Description |
|---|---|
static int |
SEARCH_ALL_LAYERS |
| Modifier and Type | Method and Description |
|---|---|
<FRAMETYPE extends WindupVertexFrame> |
findSingletonVariable(Class<FRAMETYPE> type,
String name)
Type-safe wrapper around
findVariable(String) returns a unique WindupVertexFrame. |
<T extends WindupVertexFrame> |
findSingletonVariable(String name)
Wrapper around
findVariable(String) which gives only one framed vertex, and checks if there is 0 or 1;
throws otherwise. |
Iterable<? extends WindupVertexFrame> |
findVariable(String name)
Searches the variables layers, top to bottom, for given name, and returns if found; null otherwise.
|
Iterable<? extends WindupVertexFrame> |
findVariable(String name,
int maxDepth)
Searches the variables layers, top to bottom, for given name, and returns if found; null otherwise.
|
<T extends WindupVertexFrame> |
findVariableOfType(Class<T> type)
Searches the variables layers, top to bottom, for the iterable having all of it's items of the given type.
|
static Variables |
instance(GraphRewrite event)
Get an instance of the
Variables stack from the given GraphRewrite event context. |
Map<String,Iterable<? extends WindupVertexFrame>> |
peek()
Get the top
Variables layer from the stack. |
Map<String,Iterable<? extends WindupVertexFrame>> |
pop()
Remove the top
Variables layer from the the stack. |
void |
push()
Add new
Variables layer on top of the stack. |
void |
push(Map<String,Iterable<? extends WindupVertexFrame>> frame)
Push the given
Variables layer on top of the stack. |
void |
removeVariable(String name)
Remove a variable in the top variables layer.
|
void |
setSingletonVariable(String name,
WindupVertexFrame frame)
Type-safe wrapper around setVariable which sets only one framed vertex.
|
void |
setVariable(String name,
Iterable<? extends WindupVertexFrame> frames)
Set a variable in the top variables layer to given "collection" of the vertex frames.
|
String |
toString() |
public static Variables instance(GraphRewrite event)
Variables stack from the given GraphRewrite event context.public void push()
Variables layer on top of the stack.public void push(Map<String,Iterable<? extends WindupVertexFrame>> frame)
Variables layer on top of the stack.public Map<String,Iterable<? extends WindupVertexFrame>> pop()
Variables layer from the the stack.public Map<String,Iterable<? extends WindupVertexFrame>> peek()
Variables layer from the stack.public void setSingletonVariable(String name, WindupVertexFrame frame)
public void setVariable(String name, Iterable<? extends WindupVertexFrame> frames)
public void removeVariable(String name)
public <T extends WindupVertexFrame> T findSingletonVariable(String name)
findVariable(String) which gives only one framed vertex, and checks if there is 0 or 1;
throws otherwise.public <FRAMETYPE extends WindupVertexFrame> FRAMETYPE findSingletonVariable(Class<FRAMETYPE> type, String name)
findVariable(String) returns a unique WindupVertexFrame.IllegalStateException - If more than one frame was found.public Iterable<? extends WindupVertexFrame> findVariable(String name)
public Iterable<? extends WindupVertexFrame> findVariable(String name, int maxDepth)
SEARCH_ALL_LAYERS, then search all layers.public <T extends WindupVertexFrame> Iterable<T> findVariableOfType(Class<T> type)
Copyright © 2021 JBoss by Red Hat. All rights reserved.