| FeatureMap.java |
1 /*
2 * FeatureMap.java
3 *
4 * Copyright (c) 1998-2005, 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 * Hamish Cunningham, Jan/19/2000
12 *
13 * $Id: FeatureMap.java,v 1.13 2005/01/11 13:51:30 ian Exp $
14 */
15
16 package gate;
17 import java.util.Map;
18 import java.util.Set;
19
20 import gate.creole.ontology.Taxonomy;
21 import gate.event.FeatureMapListener;
22
23 /** An attribute-value matrix. Represents the content of an annotation, the
24 * meta-data on a resource, and anything else we feel like.
25 *
26 * The event code is needed so a persistent annotation can fire updated events
27 * when its features are updated
28 */
29 public interface FeatureMap extends SimpleFeatureMap
30 {
31 /** Tests if <b>this</b> featureMap object includes aFeatureMap features.
32 * @param aFeatureMap object which will be included or not in <b>this</b>
33 * FeatureMap obj.
34 * @return <code>true</code> if <b>this</b> includes aFeatureMap
35 * and <code>false</code> if not.
36 */
37 public boolean subsumes(FeatureMap aFeatureMap);
38
39 /** Tests if <b>this</b> featureMap object includes aFeatureMap features. <br>
40 * If the feature map contains <code>class</code> and (optionally) <code>ontology</code> features:<br>
41 * then the ontologyLR is used to provide ontology based subsume with respect to the subClassOf relations.
42 * @param ontologyLR an ontology to be used for the subsume
43 * @param aFeatureMap object which will be included or not in <b>this</b>
44 * FeatureMap obj.
45 * @return <code>true</code> if <b>this</b> includes aFeatureMap
46 * and <code>false</code> if not.
47 */
48 public boolean subsumes(Taxonomy ontologyLR, FeatureMap aFeatureMap);
49
50 /** Tests if <b>this</b> featureMap object includes aFeatureMap but only
51 * for the features present in the aFeatureNamesSet.
52 * @param aFeatureMap which will be included or not in <b>this</b>
53 * FeatureMap obj.
54 * @param aFeatureNamesSet is a set of strings representing the names of the
55 * features that would be considered for subsumes.
56 * @return <code>true</code> if all features present in the aFeaturesNameSet
57 * from aFeatureMap are included in <b>this</b> obj, or <code>false</code>
58 * otherwise.
59 */
60 public boolean subsumes(FeatureMap aFeatureMap, Set aFeatureNamesSet);
61
62 /**
63 *
64 * Removes a gate listener
65 */
66 public void removeFeatureMapListener(FeatureMapListener l);
67 /**
68 *
69 * Adds a gate listener
70 */
71 public void addFeatureMapListener(FeatureMapListener l);
72
73 } // interface FeatureMap
74