INTEGRATION: CWS sb18 (1.5.84); FILE MERGED

2004/05/12 08:50:08 sb 1.5.84.1: #i21150# Added equals/hashCode.
This commit is contained in:
Oliver Bolte 2004-06-04 01:55:25 +00:00
parent 4c96683852
commit 7cfe665734

View file

@ -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 + "]";