01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.strategy.termfeature;
12:
13: import de.uka.ilkd.key.logic.Term;
14:
15: /**
16: * Term feature for checking whether the top operator of a term has an instance
17: * of a certain class
18: */
19: public class OperatorClassTF extends BinaryTermFeature {
20:
21: private final Class opClass;
22:
23: private OperatorClassTF(Class op) {
24: this .opClass = op;
25: }
26:
27: public static TermFeature create(Class op) {
28: return new OperatorClassTF(op);
29: }
30:
31: protected boolean filter(Term term) {
32: return opClass.isInstance(term.op());
33: }
34: }
|