KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > typeconstraints2 > ArrayElementVariable2


1 /*******************************************************************************
2  * Copyright (c) 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.corext.refactoring.typeconstraints2;
12
13 import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.ArrayType;
14
15
16 public final class ArrayElementVariable2 extends ConstraintVariable2 {
17
18     private final ConstraintVariable2 fParentCv;
19     
20     public ArrayElementVariable2(ConstraintVariable2 parentCv) {
21         super(((ArrayType) parentCv.getType()).getComponentType());
22         fParentCv= parentCv;
23     }
24     
25     /*
26      * @see java.lang.Object#hashCode()
27      */

28     public int hashCode() {
29         return fParentCv.hashCode();
30     }
31
32     /*
33      * @see java.lang.Object#equals(java.lang.Object)
34      */

35     public boolean equals(Object JavaDoc other) {
36         if (this == other)
37             return true;
38         if (other.getClass() != ArrayElementVariable2.class)
39             return false;
40         
41         ArrayElementVariable2 other2= (ArrayElementVariable2) other;
42         return fParentCv == other2.fParentCv;
43     }
44
45 }
46
Popular Tags