public abstract class Forest<T> {
/** assume that this forest contains exactly one tree and return it; otherwise throw an exception */
public abstract class Forest<T> {
/** assume that this forest contains exactly one tree and return it; otherwise throw an exception */
void addTo(FastSet<Body> h) {
if (!singleton) h.add(this, true);
else for(Body b : (IterableForest<T>)tokens[0]) b.addTo(h);
}
void addTo(FastSet<Body> h) {
if (!singleton) h.add(this, true);
else for(Body b : (IterableForest<T>)tokens[0]) b.addTo(h);
}
- if (rep) return "***";
- try {
- rep = true;
- StringBuffer ret = new StringBuffer();
- for(int i=0; i<tokens.length; i++) {
- String q = tokens[i]==null ? "null" : tokens[i].toString();
- if (q.length() > 0) {
- ret.append(q);
- ret.append(" ");
- }
+ StringBuffer ret = new StringBuffer();
+ for(int i=0; i<tokens.length; i++) {
+ String q = tokens[i]==null ? "null" : tokens[i].toString();
+ if (q.length() > 0) {
+ ret.append(q);
+ ret.append(" ");
HashSet<Tree<T>> ret = new HashSet<Tree<T>>();
for(Body<T> b : results)
ret.addAll(b.expand(toss, new ArrayList<Tree<T>>(), 0, new HashSet<Tree<T>>()));
HashSet<Tree<T>> ret = new HashSet<Tree<T>>();
for(Body<T> b : results)
ret.addAll(b.expand(toss, new ArrayList<Tree<T>>(), 0, new HashSet<Tree<T>>()));
// Statics //////////////////////////////////////////////////////////////////////////////
private static Tree[] tree_hint = new Tree[0];
// Statics //////////////////////////////////////////////////////////////////////////////
private static Tree[] tree_hint = new Tree[0];