本文整理汇总了Java中gov.nasa.jpf.search.Search.getTransition方法的典型用法代码示例。如果您正苦于以下问题:Java Search.getTransition方法的具体用法?Java Search.getTransition怎么用?Java Search.getTransition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.jpf.search.Search
的用法示例。
在下文中一共展示了Search.getTransition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeGdfLabel
import gov.nasa.jpf.search.Search; //导入方法依赖的package包/类
/**
* Return the string that will be used to label this state in the GDF graph.
*/
private String makeGdfLabel(Search state, int my_id) {
Transition trans = state.getTransition();
if (trans == null) {
return "-init-";
}
StringBuilder result = new StringBuilder();
if (transition_numbers) {
result.append(my_id);
result.append(':');
}
Step last_trans_step = trans.getLastStep();
result.append(last_trans_step.toString());
if (show_source) {
String source_line=last_trans_step.getLineString();
if ((source_line != null) && !source_line.equals("")) {
// We need to deal with gdf-specific special characters which couls appear
// in the Java source line, such as '"'.
result.append(source_line);
convertGdfSpecial(result);
}
}
return result.toString();
}
示例2: addEdge
import gov.nasa.jpf.search.Search; //导入方法依赖的package包/类
/**
* Create an edge in the graph file from old_id to new_id.
*/
private void addEdge(int old_id, int new_id, Search state) throws IOException {
int my_id = edge_id++;
if (format==GDF_FORMAT) {
Transition trans=state.getTransition();
int thread = trans.getThreadIndex();
// edgedef>node1,node2,label,labelvisible,directed,thread INT
// Old State -> Transition - labeled with the source info if any.
gdfEdges.add(
makeGdfEdgeString("st"+old_id, "tr"+my_id,
makeGdfLabel(state, my_id),
thread));
// Transition node: name,label,style,color
graph.write("tr" + my_id + ",\"" +my_id+"\","+transition_node_style);
graph.newLine();
// Transition -> New State - labeled with the last output if any.
String lastOutputLabel=
replaceString(convertGdfSpecial(trans.getOutput()), "\"", "\'\'");
gdfEdges.add(
makeGdfEdgeString("tr"+my_id, "st"+new_id, lastOutputLabel, thread));
} else { // DOT
graph.write(" st" + old_id + " -> tr" + my_id + ";");
graph.newLine();
graph.write(" tr" + my_id + " [label=\"" + makeDotLabel(state, my_id) +
"\",shape=box]");
graph.newLine();
graph.write(" tr" + my_id + " -> st" + new_id + ";");
}
}
示例3: makeDotLabel
import gov.nasa.jpf.search.Search; //导入方法依赖的package包/类
/**
* Return the string that will be used to label this state for the user.
*/
private String makeDotLabel(Search state, int my_id) {
Transition trans = state.getTransition();
if (trans == null) {
return "-init-";
}
Step last_trans_step = trans.getLastStep();
if (last_trans_step == null) {
return "?";
}
StringBuilder result = new StringBuilder();
if (transition_numbers) {
result.append(my_id);
result.append("\\n");
}
int thread = trans.getThreadIndex();
result.append("Thd");
result.append(thread);
result.append(':');
result.append(last_trans_step.toString());
if (show_source) {
String source_line=last_trans_step.getLineString();
if ((source_line != null) && !source_line.equals("")) {
result.append("\\n");
StringBuilder sb=new StringBuilder(source_line);
// We need to precede the dot-specific special characters which appear
// in the Java source line, such as ']' and '"', with the '\' escape
// characters and also to remove any new lines.
replaceString(sb, "\n", "");
replaceString(sb, "]", "\\]");
replaceString(sb, "\"", "\\\"");
result.append(sb.toString());
}
}
return result.toString();
}