View Javadoc

1   /*
2    wsmo4j - a WSMO API and Reference Implementation
3   
4    Copyright (c) 2005, University of Innsbruck, Austria
5   
6    This library is free software; you can redistribute it and/or modify it under
7    the terms of the GNU Lesser General Public License as published by the Free
8    Software Foundation; either version 2.1 of the License, or (at your option)
9    any later version.
10   This library is distributed in the hope that it will be useful, but WITHOUT
11   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13   details.
14   You should have received a copy of the GNU Lesser General Public License along
15   with this library; if not, write to the Free Software Foundation, Inc.,
16   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17   */
18  package org.omwg.logicalexpression.terms;
19  
20  
21  import org.omwg.ontology.*;
22  import org.wsmo.common.*;
23  
24  
25  /**
26   * <p>This interface represents a visitor for the terms of a logical expression
27   * tree structure.</p>
28   * <p>The visitor design pattern is a way of separating an algorithm from an object
29   * structure. A practical result of this separation is the ability to add new
30   * operations to existing object structures without modifying those structures.</p>
31   * <p>The idea is to use a structure of element classes, each of which has an accept
32   * method that takes a visitor object as an argument. The visitor is an interface
33   * that has a different visit() method for each element class. The accept() method
34   * of an element class calls back the visit() method for its class. Separate
35   * concrete visitor classes can then be written that perform some particular
36   * operations.</p>
37   * @author DERI Innsbruck, reto.krummenacher@deri.org
38   * @version $Revision: 1030 $ $Date: 2005-09-21 11:15:39 +0300 (Wed, 21 Sep 2005) $
39   * @see <a href "http://en.wikipedia.org/wiki/Visitor_pattern">Visitor Pattern</a>
40   */
41  public interface Visitor {
42  
43      /**
44       * @param t ConstructedTerm
45       */
46      void visitConstructedTerm(ConstructedTerm t);
47  
48      /**
49       * @param t Variable
50       */
51      void visitVariable(Variable t);
52  
53      /**
54       * @param t DataValue
55       */
56      void visitSimpleDataValue(SimpleDataValue t);
57  
58      /**
59       * @param t DataValue
60       */
61      void visitComplexDataValue(ComplexDataValue t);
62  
63      /**
64       * @param t UnNbAnonymousID
65       */
66      void visitUnnumberedID(UnnumberedAnonymousID t);
67  
68      /**
69       * @param t NbAnonymousID
70       */
71      void visitNumberedID(NumberedAnonymousID t);
72  
73      /**
74       * @param t IRI
75       */
76      void visitIRI(IRI t);
77  
78  }