Add some unit testing of the CfbSchema.
[cfb.git] / prod / net / jaekl / cfb / xml / LocalVariable.java
index a4d26d81b194043416c7b1f219b17e654ed025f6..42c282acf7bdd33893f83a176d79494c719ffbd1 100644 (file)
@@ -4,6 +4,7 @@ import java.io.PrintWriter;
 
 import org.xml.sax.Attributes;
 
+import net.jaekl.cfb.util.Util;
 import net.jaekl.qd.xml.MissingAttributeException;
 import net.jaekl.qd.xml.ParseResult;
 import net.jaekl.qd.xml.XmlParseException;
@@ -59,4 +60,24 @@ public class LocalVariable extends ParseResult {
                pw.println(tab + NAME + "=" + m_name);
                pw.println(tab + ROLE + "=" + m_role);
        }
+       
+       @Override
+       public boolean equals(Object obj) 
+       {
+               if (null == obj) {
+                       return false;
+               }
+               if (obj instanceof LocalVariable) {
+                       LocalVariable that = (LocalVariable)obj;
+                       return (   Util.objsAreEqual(this.m_name, that.m_name) 
+                                   && Util.objsAreEqual(this.m_role, that.m_role) );
+               }
+               return false;
+       }
+       
+       @Override
+       public int hashCode()
+       {
+               return ( (Util.objHashCode(m_name)) ^ (Util.objHashCode(m_role)) );
+       }
 }