01: /*
02: * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun in the LICENSE file that accompanied this code.
10: *
11: * This code is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * version 2 for more details (a copy is included in the LICENSE file that
15: * accompanied this code).
16: *
17: * You should have received a copy of the GNU General Public License version
18: * 2 along with this work; if not, write to the Free Software Foundation,
19: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25:
26: package com.sun.mirror.type;
27:
28: import com.sun.mirror.declaration.Declaration;
29: import com.sun.mirror.util.Types;
30: import com.sun.mirror.util.TypeVisitor;
31:
32: /**
33: * Represents a type in the Java programming language.
34: * Types include primitive types, class and interface types, array
35: * types, and type variables. Wildcard type arguments, and the
36: * pseudo-type representing the type of <tt>void</tt>, are represented
37: * by type mirrors as well.
38: *
39: * <p> Types may be compared using the utility methods in
40: * {@link Types}.
41: * There is no guarantee that any particular type will
42: * always be represented by the same object.
43: *
44: * @author Joseph D. Darcy
45: * @author Scott Seligman
46: * @version 1.10 07/05/05
47: *
48: * @see Declaration
49: * @see Types
50: * @since 1.5
51: */
52:
53: public interface TypeMirror {
54:
55: /**
56: * Returns a string representation of this type.
57: * Any names embedded in the expression are qualified.
58: *
59: * @return a string representation of this type
60: */
61: String toString();
62:
63: /**
64: * Tests whether two types represent the same type.
65: *
66: * @param obj the object to be compared with this type
67: * @return <tt>true</tt> if the specified object represents the same
68: * type as this.
69: */
70: boolean equals(Object obj);
71:
72: /**
73: * Applies a visitor to this type.
74: *
75: * @param v the visitor operating on this type
76: */
77: void accept(TypeVisitor v);
78: }
|