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 NegationAsFailureImpl 29 extends UnaryImpl 30 implements NegationAsFailure { 31 32 public NegationAsFailureImpl(LogicalExpression expr) 33 throws IllegalArgumentException { 34 super(expr); 35 } 36 37 public void accept(Visitor v) { 38 v.visitNegationAsFailure(this); 39 } 40 41 /** 42 * <p> 43 * The <code>equals</code> method implements an equivalence relation 44 * on non-null object references. Unary expressions are equal if their operator 45 * and their logical expression are equal. 46 * </p> 47 * <p> 48 * It is generally necessary to override the <code>hashCode</code> method whenever this method 49 * is overridden. 50 * </p> 51 * @param o the reference object with which to compare. 52 * @return <code>true</code> if this object is the same as the obj 53 * argument; <code>false</code> otherwise. 54 * @see java.lang.Object#equals(java.lang.Object) 55 * @see java.lang.Object#hashCode() 56 */ 57 public boolean equals(Object o) { 58 if (o instanceof NegationAsFailure) { 59 NegationAsFailure u = (NegationAsFailure)o; 60 return expr.equals(u.getOperand()); 61 } 62 return false; 63 } 64 65 }