KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > ReturnTypeInfo


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;
12
13 import org.eclipse.core.runtime.Assert;
14
15 import org.eclipse.jdt.core.dom.ITypeBinding;
16
17
18 public class ReturnTypeInfo {
19     
20     private final String JavaDoc fOldTypeName;
21     private String JavaDoc fNewTypeName;
22     private ITypeBinding fNewTypeBinding;
23     
24     public ReturnTypeInfo(String JavaDoc returnType) {
25         fOldTypeName= returnType;
26         fNewTypeName= returnType;
27     }
28
29     public String JavaDoc getOldTypeName() {
30         return fOldTypeName;
31     }
32     
33     public String JavaDoc getNewTypeName() {
34         return fNewTypeName;
35     }
36     
37     public void setNewTypeName(String JavaDoc type){
38         Assert.isNotNull(type);
39         fNewTypeName= type;
40     }
41
42     public ITypeBinding getNewTypeBinding() {
43         return fNewTypeBinding;
44     }
45     
46     public void setNewTypeBinding(ITypeBinding typeBinding){
47         fNewTypeBinding= typeBinding;
48     }
49
50     public boolean isTypeNameChanged() {
51         return !fOldTypeName.equals(fNewTypeName);
52     }
53     
54     public String JavaDoc toString() {
55         return fOldTypeName + " -> " + fNewTypeName; //$NON-NLS-1$
56
}
57 }
58
Popular Tags