KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > umd > cs > findbugs > ba > type > NullType


1 /*
2  * Bytecode Analysis Framework
3  * Copyright (C) 2003,2004 University of Maryland
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package edu.umd.cs.findbugs.ba.type;
21
22 import org.apache.bcel.generic.ReferenceType;
23 import org.apache.bcel.generic.Type;
24
25 /**
26  * Special type representing the null value.
27  * This is a type which is higher in the lattice than any object type,
28  * but lower than the overall Top type. It represents the type
29  * of the null value, which may logically be merged with any
30  * object type without loss of information.
31  *
32  * @author David Hovemeyer
33  * @see TypeAnalysis
34  * @see TypeFrame
35  * @see TypeMerger
36  */

37 public class NullType extends Type implements ExtendedTypes {
38
39     private static final long serialVersionUID = 1L;
40     private static final Type theInstance = new NullType();
41
42     private NullType() {
43         super(T_NULL, "<null type>");
44     }
45
46     @Override JavaDoc
47          public int hashCode() {
48         return System.identityHashCode(this);
49     }
50
51     @Override JavaDoc
52          public boolean equals(Object JavaDoc o) {
53         return o == this;
54     }
55
56     public static Type instance() {
57         return theInstance;
58     }
59 }
60
61 // vim:ts=4
62
Popular Tags