-
- // SubUnion //////////////////////////////////////////////////////////////////////////////
-
- /** FIXME this is kind of a hack */
- public class Subset extends Union {
- private final Set<Sequence> exclude;
- public Subset(String shortForm, Set<Sequence> exclude) { super(shortForm, true); this.exclude = exclude; }
- public Iterator<Sequence> iterator() {
- final Iterator<Sequence> it = Union.this.iterator();
- return new Iterator<Sequence>() {
- private Sequence next = it.hasNext() ? it.next() : null;
- public boolean hasNext() { return next != null; }
- public Sequence next() {
- Sequence ret = next;
- do {
- next = it.hasNext() ? it.next() : null;
- } while (next != null && (next instanceof Sequence) && exclude.contains((Sequence)next));
- return ret;
- }
- public void remove() { throw new Error(); }
- };
+
+ private void bodyToString(StringBuffer sb, String before, String between) {
+ boolean first = true;
+ for(Sequence s : this) {
+ if (s.lame) continue;
+ // FIXME: what to do here about printing out negated sequences?
+ sb.append(first ? before : between);
+ first = false;
+ sb.append(s.toString());