net.ericaro.diezel.core.builder.Transition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of diezel-maven-plugin Show documentation
Show all versions of diezel-maven-plugin Show documentation
An Embedded Domain Specific Language Parser Generator PLugin compiler
The newest version!
package net.ericaro.diezel.core.builder;
import java.util.ArrayList;
import java.util.List;
import edu.uci.ics.jung.graph.DirectedGraph;
/** A transition is an edsl call, i.e an edge in the graph, or a method in a state interface.
*
* @author eric
*
*/
public class Transition {
String alias;
String javadoc;
List pushes = new ArrayList();
List pulls= new ArrayList();
String signature ="";
String returnType;
public Transition(String alias) {
super();
this.alias = alias;
}
public String getAlias() {
return alias;
}
public String getJavadoc() {
return javadoc;
}
public void setJavadoc(String javadoc) {
this.javadoc = javadoc;
}
public void addPush(Generic... pushes){
for(Generic push: pushes)
this.pushes.add(push);
}
public void addPull(Generic... pulls){
for(Generic pull: pulls)
this.pulls.add(pull);
}
public List getPushes() {
return pushes;
}
public List getPulls() {
return pulls;
}
public void setSignature(String signature) {
this.signature = signature;
}
public void setReturnType(String str) {
this.returnType = str;
}
public String getSignature() {
return signature;
}
public String getReturnType() {
return returnType;
}
/** Graph are actually made of "instances" of transition, since a transition can lay in several edges of the graph.
*
* @param graph
* @return
*/
public TransitionInstance newInstance(DirectedGraph graph) {
return new TransitionInstance(this, graph);
}
}