|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
DisjunctionImpl.java | 0% | 0% | 0% | 0% |
|
1 | /* | |
2 | wsmo4j - a WSMO API and Reference Implementation | |
3 | Copyright (c) 2005 University of Innsbruck, Austria | |
4 | 2005 National University of Ireland, Galway | |
5 | This library is free software; you can redistribute it and/or modify it under | |
6 | the terms of the GNU Lesser General Public License as published by the Free | |
7 | Software Foundation; either version 2.1 of the License, or (at your option) | |
8 | any later version. | |
9 | This library is distributed in the hope that it will be useful, but WITHOUT | |
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
11 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | |
12 | details. | |
13 | You should have received a copy of the GNU Lesser General Public License along | |
14 | with this library; if not, write to the Free Software Foundation, Inc., | |
15 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
16 | */ | |
17 | ||
18 | package org.deri.wsmo4j.logicalexpression; | |
19 | ||
20 | ||
21 | import org.omwg.logicalexpression.*; | |
22 | ||
23 | ||
24 | /** | |
25 | * @author DERI Innsbruck, reto.krummenacher@deri.org | |
26 | * @author DERI Innsbruck, thomas.haselwanter@deri.org | |
27 | */ | |
28 | public class DisjunctionImpl | |
29 | extends BinaryImpl | |
30 | implements Disjunction { | |
31 | ||
32 | 0 | public DisjunctionImpl(LogicalExpression exprLeft, LogicalExpression exprRight) |
33 | throws IllegalArgumentException { | |
34 | 0 | super(exprLeft, exprRight); |
35 | } | |
36 | ||
37 | 0 | public void accept(Visitor v) { |
38 | 0 | v.visitDisjunction(this); |
39 | } | |
40 | ||
41 | ||
42 | /** | |
43 | * <p> | |
44 | * The <code>equals</code> method implements an equivalence relation | |
45 | * on non-null object references. Binary expressions are equal if their operator, their | |
46 | * left logical expression and their right logical expression are equal. | |
47 | * In case the operator is either EQUIVALENT, OR or AND, the left logical expression | |
48 | * must to be equal to either the left or the right logical expression of the obj | |
49 | * argument and analogous for the right logical expression. | |
50 | * </p> | |
51 | * <p> | |
52 | * It is generally necessary to override the <code>hashCode</code> method whenever this method | |
53 | * is overridden. | |
54 | * </p> | |
55 | * @param o the reference object with which to compare. | |
56 | * @return <code>true</code> if this object is the same as the obj | |
57 | * argument; <code>false</code> otherwise. | |
58 | * @see java.lang.Object#equals(java.lang.Object) | |
59 | * @see java.lang.Object#hashCode() | |
60 | */ | |
61 | 0 | public boolean equals(Object o) { |
62 | 0 | if (o instanceof Disjunction) { |
63 | 0 | Disjunction b = (Disjunction)o; |
64 | 0 | return ((b.getLeftOperand().equals(exprLeft) |
65 | && b.getRightOperand().equals(exprRight)) | |
66 | || (b.getRightOperand().equals(exprLeft) | |
67 | && b.getLeftOperand().equals(exprRight))); | |
68 | } | |
69 | 0 | return false; |
70 | } | |
71 | } |
|