001    /*
002    // $Id: //open/mondrian/src/main/mondrian/rolap/MemberKey.java#6 $
003    // This software is subject to the terms of the Common Public License
004    // Agreement, available at the following URL:
005    // http://www.opensource.org/licenses/cpl.html.
006    // Copyright (C) 2002-2002 Kana Software, Inc.
007    // Copyright (C) 2002-2008 Julian Hyde and others
008    // All Rights Reserved.
009    // You must accept the terms of that agreement to use this software.
010    //
011    // jhyde, 21 March, 2002
012    */
013    package mondrian.rolap;
014    
015    /**
016     * <code>MemberKey</code> todo:
017     *
018     * @author jhyde
019     * @since 21 March, 2002
020     * @version $Id: //open/mondrian/src/main/mondrian/rolap/MemberKey.java#6 $
021     */
022    class MemberKey {
023        private final RolapMember parent;
024        private final Object value;
025        MemberKey(RolapMember parent, Object value) {
026            this.parent = parent;
027            this.value = value;
028        }
029        // override Object
030        public boolean equals(Object o) {
031            if (!(o instanceof MemberKey)) {
032                return false;
033            }
034            MemberKey other = (MemberKey) o;
035            return (other.parent == this.parent) &&
036                other.value.equals(this.value);
037        }
038        // override Object
039        public int hashCode() {
040            return ((parent == null)
041                ? 0
042                : parent.hashCode() << 16) ^ value.hashCode();
043        }
044    }
045    
046    // End MemberKey.java