SimpleDocument.java
01 /*
02  *  SimpleDocument.java
03  *
04  *  Copyright (c) 1995-2010, The University of Sheffield. See the file
05  *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
06  *
07  *  This file is part of GATE (see http://gate.ac.uk/), and is free
08  *  software, licenced under the GNU Library General Public License,
09  *  Version 2, June 1991 (in the distribution as file licence.html,
10  *  and also available at http://gate.ac.uk/gate/licence.html).
11  *
12  *  Kalina Bontcheva, 23/Jul/2004
13  *
14  *  $Id: SimpleDocument.java 12006 2009-12-01 17:24:28Z thomas_heitz $
15  */
16 
17 package gate;
18 
19 import java.net.URL;
20 import java.util.Map;
21 import java.util.Set;
22 
23 import gate.util.InvalidOffsetException;
24 
25 
26 /** Represents the commonalities between all sorts of documents.
27  */
28 public interface SimpleDocument extends LanguageResource, Comparable {
29 
30   /**
31    * The parameter name for the document URL
32    */
33   public static final String
34     DOCUMENT_URL_PARAMETER_NAME = "sourceUrl";
35 
36   /** Documents are identified by URLs
37    */
38   public URL getSourceUrl();
39 
40   /** Set method for the document's URL
41    */
42   public void setSourceUrl(URL sourceUrl);
43 
44   public DocumentContent getContent();
45 
46   /** Set method for the document content
47    */
48   public void setContent(DocumentContent newContent);
49 
50   /** Get the default set of annotations. The set is created if it
51    *  doesn't exist yet.
52    */
53   public AnnotationSet getAnnotations();
54 
55   /** Get a named set of annotations. Creates a new set if one with this
56    *  name doesn't exist yet.
57    */
58   public AnnotationSet getAnnotations(String name);
59 
60   /** @return a set of all named annotation sets in existence or null if none.
61     */
62   public Set<String> getAnnotationSetNames();
63 
64   /**
65    * Removes one of the named annotation sets.
66    * Note that the default annotation set cannot be removed.
67    @param name the name of the annotation set to be removed
68    */
69   public void removeAnnotationSet(String name);
70 
71 // interface SimpleDocument