e8345f0c94b5c4be6ca31e90adb828c57963a93f
[sbp.git] / src / edu / berkeley / sbp / Atom.java
1 package edu.berkeley.sbp;
2 import java.io.*;
3 import java.util.*;
4 import java.lang.reflect.*;
5 import java.lang.ref.*;
6 import edu.berkeley.sbp.util.*;
7 import edu.berkeley.sbp.*;
8 import edu.berkeley.sbp.*;
9
10 /**
11  *  <font color=green>an element which matches some set of one-token-long input strings</font>.
12  *
13  *  <p>
14  *  This class is a topology over itself (yes, that's sort of <a
15  *  href=http://en.wikipedia.org/wiki/Frege>Frege'd</a> up) so that
16  *  Atoms can be intersected and unioned with each other to result in
17  *  other Atom<Token>'s (rather than raw Topology<Token>'s, which are
18  *  not Elements).  If you want the latter, use the getTokenTopology()
19  *  method.
20  *  </p>
21  */
22 public abstract class Atom<Token> extends Element implements Topology<Atom<Token>> {
23
24     /** the set (topology) of tokens that can match this element */
25     public abstract Topology<Token>  getTokenTopology();
26
27     StringBuffer toString(StringBuffer sb) { sb.append(this); return sb; }
28
29 }
30
31