AnnotationGraph.java
01 /*
02  *  AnnotationGraph.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, June1991.
10  *
11  *  A copy of this licence is included in the distribution in the file
12  *  licence.html, and is also available at http://gate.ac.uk/gate/licence.html.
13  *
14  *  Hamish Cunningham, 19/Jan/2000
15  *
16  *  $Id: AnnotationGraph.java 12006 2009-12-01 17:24:28Z thomas_heitz $
17  */
18 
19 package gate;
20 
21 import java.util.*;
22 import gate.util.*;
23 
24 /** NOT IN USE AT PRESENT. <P>Annotation graphs are defined at
25   * <A HREF=http://www.ldc.upenn.edu/annotation/>the LDC's annotation site</A>
26   */
27 public interface AnnotationGraph {
28 
29   /** find a node by ID */
30   public Node getNode(Long id);
31 
32   //  /** Greatest lower bound on an annotation: the greatest anchor in the AG
33   //    * such that there is a node with this anchor which structurally precedes
34   //    * the start node of annotation a. */
35   //  public Long greatestLowerBound(Annotation a);
36   //
37   //  /** Least upper bound on an annotation: the smallest anchor in the AG
38   //    * such that there is a node with this anchor is structurally preceded
39   //    * by the end node of annotation a. */
40   //  public Long leastUpperBound(Annotation a);
41   //
42   //  /** The set of annotations overlapping a */
43   //  public AnnotationGraph getOverlappingAnnotations(Annotation a);
44   //
45   //  /** The set of annotations included by a */
46   //  public AnnotationGraph getIncludedAnnotations(Annotation a);*/
47 
48   /** Get annotations by type */
49   public AnnotationGraph getAnnotations(String type);
50 
51   /** Get annotations by type and features */
52   public AnnotationGraph getAnnotations(String type, FeatureMap features);
53 
54   /** Get annotations by type and position. This is the set of annotations of
55     * a particular type which share the smallest leastUpperBound that is >=
56     * offset
57     */
58   public AnnotationGraph getAnnotations(String type, Long offset);
59 
60   /** Get annotations by type, features and offset */
61   public AnnotationGraph getAnnotations(String type, FeatureMap features,
62           Long offset);
63 
64   /** Creates a new node with the offset offset
65     @param offset the offset in document where the node will point
66     */
67   public Node putNodeAt(Long id, long offset)
68     throws gate.util.InvalidOffsetException;
69 
70   /** Returns the Id of the annotation graph*/
71   public Long getId();
72 
73   public Annotation newAnnotation(Long id, Node start, Node end, String type);
74 
75   public Annotation newAnnotation(Long id,long start, long end, String type);
76 
77 // interface AnnotationGraph