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 import org.omwg.logicalexpression.Visitor; 23 import org.omwg.logicalexpression.terms.*; 24 25 26 /** 27 * @author DERI Innsbruck, reto.krummenacher@deri.org 28 * @author DERI Innsbruck, thomas.haselwanter@deri.org 29 * @author DERI Innsbruck, holger.lausen@deri.org 30 */ 31 public class AttributeValueMoleculeImpl 32 extends AttributeMoleculeImpl 33 implements 34 AttributeValueMolecule { 35 36 public AttributeValueMoleculeImpl(Term leftTerm, Term attributeName, Term rightTerm) { 37 super(leftTerm,attributeName,rightTerm); 38 } 39 40 public void accept(Visitor v) { 41 v.visitAttributeValueMolecule(this); 42 } 43 44 /** 45 * <p> 46 * The <code>equals</code> method implements an equivalence relation 47 * on non-null object references. Attribute Specifications are equal if their operator, 48 * their name and their arguments are equal. 49 * </p> 50 * <p> 51 * It is generally necessary to override the <code>hashCode</code> method whenever this method 52 * is overridden. 53 * </p> 54 * @param o the reference object with which to compare. 55 * @return <code>true</code> if this object is the same as the obj 56 * argument; <code>false</code> otherwise. 57 * @see java.lang.Object#equals(java.lang.Object) 58 * @see java.lang.Object#hashCode() 59 */ 60 public boolean equals(Object o) { 61 if (o instanceof AttributeValueMolecule) { 62 AttributeValueMolecule as = (AttributeValueMolecule)o; 63 return (attributeName.equals(as.getAttribute()) 64 && getLeftParameter().equals(as.getLeftParameter()) 65 && getRightParameter().equals(as.getRightParameter())); 66 } 67 return false; 68 } 69 }