/** * Do vlozene mnoziny vklada Nody dostupne pomoci E prechodu z tohoto objektu * * @param actual * @return * @throws AutomatException */ protected Set addETransition(Set actual) throws AutomatException { Set c = getETransitionTarget(); Iterator i = c.iterator(); Node tmp; while (i.hasNext()) { tmp = (Node) i.next(); if (!actual.contains(tmp)) { actual.add(tmp); tmp.addETransition(actual); } } return c; }
/** * Vraci kolekci vsech nodu dostupnych zadanym znakem a vsech nodu dostupnych z nasledujicich * pomoci E prechodu * * @param znak * @return */ public Set getTransition(char znak) { HashSet v = new HashSet(); Transition t; for (int i = 0; i < transitions.size(); i++) { t = (Transition) transitions.get(i); try { if (!(t instanceof ETransition)) { if (t.getLetter() == znak) { Node n = t.getTarget(); v.add(n); n.addETransition(v); // Pridat stavy dosazitelne pomoci E z Nodu n // v.addAll(c); // Pridat samotny nod n } } } catch (AutomatException e) { continue; } } return v; }