public abstract class Atom<T> extends Element implements Topology<Atom<T>> {
public abstract Topology<T> underlying();
- public abstract String toString();
- public StringBuffer toString(StringBuffer sb) { sb.append(this); return sb; }
+ public abstract String toString();
+ public StringBuffer toString(StringBuffer sb) { sb.append(this); return sb; }
}
// if the element following this position is an atom, copy the corresponding
// set of rows out of the "master" goto table and into this state's shift table
if (p.element() != null && p.element() instanceof Atom)
- state.shifts.addAll(state.gotoSetTerminals.subset(((Atom)p.element())));
+ state.shifts.addAll(state.gotoSetTerminals.subset(((Atom)p.element()).underlying()));
}
if (top instanceof IntegerTopology)
for(State<Tok> state : all_states.values()) {
Atom a = (Atom)position.element();
HashSet<Position> hp = new HashSet<Position>();
reachable(position.next(), hp);
- bag0.addAll(a, hp);
+ bag0.addAll(a.underlying(), hp);
}
// Step 1b: for each _minimal, contiguous_ set of characters having an identical next-position
public void putAll(Topology<K> k, Iterable<V> vi) { if (vi!=null) for(V v : vi) put(k, v); }
public void put(Topology<K> t, V v) {
- // XXX hack
- if (t instanceof Atom) t = ((Atom)t).underlying();
for(Topology<K> ht : h.keySet()) {
if (t.disjoint(ht)) continue;
if (t.containsAll(ht) && ht.containsAll(t)) {