| DefaultAnnotationFactory.java |
1 /*
2 * Created on Jul 25, 2005
3 */
4 package gate.annotation;
5
6 import gate.Annotation;
7 import gate.AnnotationSet;
8 import gate.FeatureMap;
9 import gate.Node;
10
11 /**
12 * The default Annotation factory that creates instances of {@link
13 * gate.annotation.AnnotationImpl}. If you wish to create an alternative
14 * {@link gate.Annotation} class, you must create your own Annotation factory
15 * that creates annotations of this type, and register it.
16 *
17 * @author Ken Williams
18 */
19 public class DefaultAnnotationFactory implements AnnotationFactory {
20
21 /**
22 * Creates a new DefaultAnnotationFactory.
23 */
24 public DefaultAnnotationFactory() {
25 }
26
27 public Annotation createAnnotationInSet(AnnotationSet set, Integer id,
28 Node start, Node end, String type,
29 FeatureMap features) {
30 AnnotationImpl a = new AnnotationImpl(id, start, end, type, features);
31 set.add(a);
32 return a;
33 }
34 }
35