commit | 751f0f9fbd2bbdde795608c94082d7291163b9f3 | [log] [tgz] |
---|---|---|
author | buyingyi <buyingyi@eaa15691-b419-025a-1212-ee371bd00084> | Mon Apr 30 22:54:43 2012 +0000 |
committer | buyingyi <buyingyi@eaa15691-b419-025a-1212-ee371bd00084> | Mon Apr 30 22:54:43 2012 +0000 |
tree | 4dab1e444528913ff51613078f2118c855ced29a | |
parent | 1a300b28c4d4ce74b24760093aaaa05cfe482892 [diff] |
add equals implementation to the two abstract types git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization@171 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AbstractComplexType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AbstractComplexType.java index 5cd3798..2e41d79 100644 --- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AbstractComplexType.java +++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AbstractComplexType.java
@@ -1,17 +1,24 @@ package edu.uci.ics.asterix.om.types; +import edu.uci.ics.asterix.om.base.IAObject; + public abstract class AbstractComplexType implements IAType { - private static final long serialVersionUID = 1L; - protected String typeName; + private static final long serialVersionUID = 1L; + protected String typeName; - public AbstractComplexType(String typeName) { - this.typeName = typeName; - } + public AbstractComplexType(String typeName) { + this.typeName = typeName; + } - @Override - public String getTypeName() { - return typeName; - } + @Override + public String getTypeName() { + return typeName; + } + + @Override + public boolean equals(Object object) { + return this.deepEqual((IAObject) object); + } }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java index d289b01..3af6e6f 100644 --- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java +++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java
@@ -521,6 +521,11 @@ } @Override + public boolean equals(Object object) { + return this.deepEqual((IAObject) object); + } + + @Override public int hash() { return getType().getTypeTag().serialize(); }