KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.core.runtime.Assert;
14
15 import org.eclipse.jdt.core.ICompilationUnit;
16
17 import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.CompilationUnitRange;
18 import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType;
19
20 public final class CastVariable2 extends ConstraintVariable2 implements ITypeConstraintVariable {
21
22     private final CompilationUnitRange fRange;
23     private final ConstraintVariable2 fExpressionVariable;
24
25     public CastVariable2(TType type, CompilationUnitRange range, ConstraintVariable2 expressionVariable) {
26         super(type);
27         Assert.isNotNull(expressionVariable);
28         Assert.isNotNull(range);
29         fRange= range;
30         fExpressionVariable= expressionVariable;
31     }
32     
33     public CompilationUnitRange getRange() {
34         return fRange;
35     }
36     
37     public ICompilationUnit getCompilationUnit() {
38         return fRange.getCompilationUnit();
39     }
40     
41     public void setCompilationUnit(ICompilationUnit unit) {
42         throw new UnsupportedOperationException JavaDoc();
43     }
44     
45     public ConstraintVariable2 getExpressionVariable() {
46         return fExpressionVariable;
47     }
48     
49     // hashCode() and equals(..) not necessary (unique per construction)
50
}
51
Popular Tags