| SimpleDocument.java |
1 /*
2 * SimpleDocument.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: SimpleDocument.java,v 1.1 2004/07/23 11:33:20 kalina Exp $
14 */
15
16 package gate;
17
18 import java.net.URL;
19 import java.util.Map;
20 import java.util.Set;
21
22 import gate.util.InvalidOffsetException;
23
24
25 /** Represents the commonalities between all sorts of documents.
26 */
27 public interface SimpleDocument extends LanguageResource, Comparable {
28
29 /**
30 * The parameter name for the document URL
31 */
32 public static final String
33 DOCUMENT_URL_PARAMETER_NAME = "sourceUrl";
34
35 /** Documents are identified by URLs
36 */
37 public URL getSourceUrl();
38
39 /** Set method for the document's URL
40 */
41 public void setSourceUrl(URL sourceUrl);
42
43 public DocumentContent getContent();
44
45 /** Set method for the document content
46 */
47 public void setContent(DocumentContent newContent);
48
49 /** Get the default set of annotations. The set is created if it
50 * doesn't exist yet.
51 */
52 public AnnotationSet getAnnotations();
53
54 /** Get a named set of annotations. Creates a new set if one with this
55 * name doesn't exist yet.
56 */
57 public AnnotationSet getAnnotations(String name);
58
59 /** Returns a set of all named annotation sets in existence
60 */
61 public Set getAnnotationSetNames();
62
63 /**
64 * Removes one of the named annotation sets.
65 * Note that the default annotation set cannot be removed.
66 * @param name the name of the annotation set to be removed
67 */
68 public void removeAnnotationSet(String name);
69
70 } // interface SimpleDocument
71
72