KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > typeconstraints > types > NullType


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.typeconstraints.types;
12
13
14 public final class NullType extends TType {
15
16     protected NullType(TypeEnvironment environment) {
17         super(environment, "N"); //$NON-NLS-1$
18
}
19
20     public int getKind() {
21         return NULL_TYPE;
22     }
23
24     public TType[] getSubTypes() {
25         throw new UnsupportedOperationException JavaDoc();
26     }
27     
28     protected boolean doEquals(TType type) {
29         return true;
30     }
31
32     public String JavaDoc getName() {
33         return "null"; //$NON-NLS-1$
34
}
35     
36     protected String JavaDoc getPlainPrettySignature() {
37         return getName();
38     }
39     
40     protected boolean doCanAssignTo(TType lhs) {
41         int kind= lhs.getKind();
42         return kind != PRIMITIVE_TYPE && kind != VOID_TYPE;
43     }
44 }
45
Popular Tags