KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mondrian > rolap > MemberKey


1 /*
2 // $Id: //open/mondrian/src/main/mondrian/rolap/MemberKey.java#5 $
3 // This software is subject to the terms of the Common Public License
4 // Agreement, available at the following URL:
5 // http://www.opensource.org/licenses/cpl.html.
6 // Copyright (C) 2002-2002 Kana Software, Inc.
7 // Copyright (C) 2002-2005 Julian Hyde and others
8 // All Rights Reserved.
9 // You must accept the terms of that agreement to use this software.
10 //
11 // jhyde, 21 March, 2002
12 */

13 package mondrian.rolap;
14
15 /**
16  * <code>MemberKey</code> todo:
17  *
18  * @author jhyde
19  * @since 21 March, 2002
20  * @version $Id: //open/mondrian/src/main/mondrian/rolap/MemberKey.java#5 $
21  */

22 class MemberKey {
23     private final RolapMember parent;
24     private final Object JavaDoc value;
25     MemberKey(RolapMember parent, Object JavaDoc value) {
26         this.parent = parent;
27         this.value = value;
28     }
29     // override Object
30
public boolean equals(Object JavaDoc o) {
31         if (!(o instanceof MemberKey)) {
32             return false;
33         }
34         MemberKey other = (MemberKey) o;
35         return (other.parent == this.parent) &&
36             other.value.equals(this.value);
37     }
38     // override Object
39
public int hashCode() {
40         return ((parent == null)
41             ? 0
42             : parent.hashCode() << 16) ^ value.hashCode();
43     }
44 }
45
46 // End MemberKey.java
47
Popular Tags