G
Gast
Gast
wie soll ich den Code abändern, dass das Programm nicht terminiert, wenn ein Zyklus entsteht.
Danke im vorraus.
Danke im vorraus.
Code:
public String findNext(String key)
{
Transition t = (Transition)htStart.get(key);
if(t == null) return null;
return t.getEnd();
}
public void findEnd()
{
for(int i=0; i<htEnd.size(); i++)
{
}
}
public void checkRecords()
{
Hashtable htChecked = new Hashtable();
System.out.println("find start = "+findStart());
String root = findStart();
if(root != null)
{
String oldNext, next = findNext(root);
htChecked.put(root, "");
System.out.println("root "+root+" -> "+next);
while(next != null && !htChecked.containsKey(next) )
{
htChecked.put(next,"");
oldNext = next;
next = findNext(next);
System.out.println(oldNext+" -> "+next);
}
}
}