| Matcher.java |
1 /*
2 * Matcher.java - transducer class
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, 24/07/98
12 *
13 * $Id: Matcher.java,v 1.7 2005/01/11 13:51:36 ian Exp $
14 */
15
16
17 package gate.jape;
18
19 import gate.Document;
20
21
22 /**
23 * Interface to be implemented by classes providing matching on documents,
24 * e.g. PatternElement and LeftHandSide.
25 */
26 public interface Matcher extends java.io.Serializable
27 {
28 /** Does this element match the document at this position? */
29 abstract public boolean matches(
30 Document doc, int position, MutableInteger newPosition
31 );
32
33 /** Reset: clear annotation caches etc. */
34 abstract public void reset();
35
36 /** Finish: replace dynamic data structures with Java arrays; called
37 * after parsing.
38 */
39 abstract public void finish();
40
41 } // class Matcher
42
43
44 // $Log: Matcher.java,v $
45 // Revision 1.7 2005/01/11 13:51:36 ian
46 // Updating copyrights to 1998-2005 in preparation for v3.0
47 //
48 // Revision 1.6 2004/07/21 17:10:08 akshay
49 // Changed copyright from 1998-2001 to 1998-2004
50 //
51 // Revision 1.5 2004/03/25 13:01:14 valyt
52 // Imports optimisation throughout the Java sources
53 // (to get rid of annoying warnings in Eclipse)
54 //
55 // Revision 1.4 2001/09/13 12:09:50 kalina
56 // Removed completely the use of jgl.objectspace.Array and such.
57 // Instead all sources now use the new Collections, typically ArrayList.
58 // I ran the tests and I ran some documents and compared with keys.
59 // JAPE seems to work well (that's where it all was). If there are problems
60 // maybe look at those new structures first.
61 //
62 // Revision 1.3 2000/11/08 16:35:03 hamish
63 // formatting
64 //
65 // Revision 1.2 2000/10/10 15:36:36 oana
66 // Changed System.out in Out and System.err in Err;
67 // Added the DEBUG variable seted on false;
68 // Added in the header the licence;
69 //
70 // Revision 1.1 2000/02/23 13:46:08 hamish
71 // added
72 //
73 // Revision 1.1.1.1 1999/02/03 16:23:02 hamish
74 // added gate2
75 //
76 // Revision 1.4 1998/11/01 21:21:38 hamish
77 // use Java arrays in transduction where possible
78 //
79 // Revision 1.3 1998/10/29 12:09:08 hamish
80 // added serializable
81 //
82 // Revision 1.2 1998/08/12 15:39:38 hamish
83 // added padding toString methods
84 //
85 // Revision 1.1 1998/08/03 19:51:23 hamish
86 // rollback added
87