1 /***
2 * ***************************************************************
3 * JADE - Java Agent DEvelopment Framework is a framework to develop
4 * multi-agent systems in compliance with the FIPA specifications.
5 * Copyright (C) 2000 CSELT S.p.A.
6 *
7 * GNU Lesser General Public License
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation,
12 * version 2.1 of the License.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
23 * **************************************************************
24 */
25 package JADE_SL.onto.basic;
26
27 import JADE_SL.*;
28 import JADE_SL.abs.*;
29 import JADE_SL.onto.*;
30
31 public class Equals implements Predicate {
32 private Object left;
33 private Object right;
34
35 public Equals() {
36 left = null;
37 right = null;
38 }
39
40 public Equals(Object l, Object r) {
41 setLeft(l);
42 setRight(r);
43 }
44
45 public Object getLeft() {
46 return left;
47 }
48
49 public void setLeft(Object l) {
50 try {
51 Ontology.checkIsTerm(l);
52 }
53 catch (OntologyException oe) {
54 throw new IllegalArgumentException(oe.getMessage());
55 }
56 left = l;
57 }
58
59 public Object getRight() {
60 return right;
61 }
62
63 public void setRight(Object r) {
64 try {
65 Ontology.checkIsTerm(r);
66 }
67 catch (OntologyException oe) {
68 throw new IllegalArgumentException(oe.getMessage());
69 }
70 right = r;
71 }
72
73 }