| SimpleAnnotationSet.java |
1 /*
2 * SimpleAnnotationSet.java
3 *
4 * Copyright (c) 1998-2004, The University of Sheffield.
5 *
6 * This file is part of GATE (see http://gate.ac.uk/), and is free
7 * software, licenced under the GNU Library General Public License,
8 * Version 2, June 1991 (in the distribution as file licence.html,
9 * and also available at http://gate.ac.uk/gate/licence.html).
10 *
11 * Kalina Bontcheva, 23/Jul/2004
12 *
13 * $Id: SimpleAnnotationSet.java,v 1.1 2004/07/23 11:33:20 kalina Exp $
14 */
15
16 package gate;
17
18 import java.io.Serializable;
19 import java.util.Iterator;
20 import java.util.Set;
21
22 import gate.util.InvalidOffsetException;
23
24 /** Annotation sets */
25 public interface SimpleAnnotationSet extends Set, Cloneable, Serializable
26 {
27 /** Create and add an annotation with pre-existing nodes,
28 * and return its id
29 */
30 public Integer add(Node start, Node end, String type, FeatureMap features);
31
32 /** Create and add an annotation and return its id */
33 public Integer add(Long start, Long end, String type, FeatureMap features)
34 throws InvalidOffsetException;
35
36 /** Add an existing annotation. Returns true when the set is modified. */
37 public boolean add(Object o);
38
39 /** Get an iterator for this set */
40 public Iterator iterator();
41
42 /** The size of this set */
43 public int size();
44
45 /** Remove an element from this set. */
46 public boolean remove(Object o);
47
48 /** Find annotations by id */
49 public Annotation get(Integer id);
50
51 /** Get all annotations */
52 public AnnotationSet get();
53
54 /** Select annotations by type */
55 public AnnotationSet get(String type);
56
57 /** Select annotations by a set of types. Expects a Set of String. */
58 public AnnotationSet get(Set types);
59
60 /** Get the name of this set. */
61 public String getName();
62
63 /** Get a set of java.lang.String objects representing all the annotation
64 * types present in this annotation set.
65 */
66 public Set getAllTypes();
67
68 /** Get the document this set is attached to. */
69 public Document getDocument();
70
71 } // interface SimpleAnnotationSet
72