summaryrefslogtreecommitdiff
path: root/ridljar
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-06-04 01:55:25 +0000
committerOliver Bolte <obo@openoffice.org>2004-06-04 01:55:25 +0000
commit10098929fc579503a2ee78427c04e1aa6470119b (patch)
tree734d78641f30e4eb35fad4a13c1f8df37f17bd27 /ridljar
parent8aac2e5218ba55d6eec84fa11ec328731aa81dc3 (diff)
INTEGRATION: CWS sb18 (1.5.84); FILE MERGED
2004/05/12 08:50:08 sb 1.5.84.1: #i21150# Added equals/hashCode.
Diffstat (limited to 'ridljar')
-rw-r--r--ridljar/com/sun/star/uno/Any.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/ridljar/com/sun/star/uno/Any.java b/ridljar/com/sun/star/uno/Any.java
index 0dabf67c1..8325bf80b 100644
--- a/ridljar/com/sun/star/uno/Any.java
+++ b/ridljar/com/sun/star/uno/Any.java
@@ -2,9 +2,9 @@
*
* $RCSfile: Any.java,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: hr $ $Date: 2003-03-26 15:44:54 $
+ * last change: $Author: obo $ $Date: 2004-06-04 02:55:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,7 +72,7 @@ package com.sun.star.uno;
* an explicit interface type, so the remote counterpart doesn't need to invoke
* a queryInterface).
* <p>
- * @version $Revision: 1.5 $ $ $Date: 2003-03-26 15:44:54 $
+ * @version $Revision: 1.6 $ $ $Date: 2004-06-04 02:55:25 $
* @since UDK1.0
*/
public class Any {
@@ -134,6 +134,20 @@ public class Any {
return _object;
}
+ // @see java.lang.Object#equals
+ public boolean equals(Object obj) {
+ return obj instanceof Any && _type.equals(((Any) obj)._type)
+ && (_object == null
+ ? ((Any) obj)._object == null
+ : _object.equals(((Any) obj)._object));
+ }
+
+ // @see java.lang.Object#hashCode
+ public int hashCode() {
+ return _type.hashCode() * 13
+ + (_object == null ? 0 : _object.hashCode());
+ }
+
// @see java.lang.Object#toString
public String toString() {
return "Any[" + _type + ", " + _object + "]";