Matcher.java |
1 /* 2 * Matcher.java - transducer class 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 * Hamish Cunningham, 24/07/98 12 * 13 * $Id: Matcher.java,v 1.6 2004/07/21 17:10:08 akshay 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.6 2004/07/21 17:10:08 akshay 46 // Changed copyright from 1998-2001 to 1998-2004 47 // 48 // Revision 1.5 2004/03/25 13:01:14 valyt 49 // Imports optimisation throughout the Java sources 50 // (to get rid of annoying warnings in Eclipse) 51 // 52 // Revision 1.4 2001/09/13 12:09:50 kalina 53 // Removed completely the use of jgl.objectspace.Array and such. 54 // Instead all sources now use the new Collections, typically ArrayList. 55 // I ran the tests and I ran some documents and compared with keys. 56 // JAPE seems to work well (that's where it all was). If there are problems 57 // maybe look at those new structures first. 58 // 59 // Revision 1.3 2000/11/08 16:35:03 hamish 60 // formatting 61 // 62 // Revision 1.2 2000/10/10 15:36:36 oana 63 // Changed System.out in Out and System.err in Err; 64 // Added the DEBUG variable seted on false; 65 // Added in the header the licence; 66 // 67 // Revision 1.1 2000/02/23 13:46:08 hamish 68 // added 69 // 70 // Revision 1.1.1.1 1999/02/03 16:23:02 hamish 71 // added gate2 72 // 73 // Revision 1.4 1998/11/01 21:21:38 hamish 74 // use Java arrays in transduction where possible 75 // 76 // Revision 1.3 1998/10/29 12:09:08 hamish 77 // added serializable 78 // 79 // Revision 1.2 1998/08/12 15:39:38 hamish 80 // added padding toString methods 81 // 82 // Revision 1.1 1998/08/03 19:51:23 hamish 83 // rollback added 84