This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.lang.model.type
interface TypeMirror

All Known Subinterfaces:
ExecutableType, NoType, PrimitiveType, ReferenceType, WildcardType, ArrayType, DeclaredType, NullType, TypeVariable, ErrorType

public interface TypeMirror

Represents a type in the Java programming language. Types include primitive types, declared types (class and interface types), array types, type variables, and the null type. Also represented are wildcard type arguments, the signature and return types of executables, and pseudo-types corresponding to packages and to the keyword {@code void}.

Types should be compared using the utility methods in {@link Types}. There is no guarantee that any particular type will always be represented by the same object.

To implement operations based on the class of an {@code TypeMirror} object, either use a {@linkplain TypeVisitor visitor} or use the result of the {@link #getKind} method. Using {@code instanceof} is not necessarily a reliable idiom for determining the effective class of an object in this modeling hierarchy since an implementation may choose to have a single object implement multiple {@code TypeMirror} subinterfaces.


Method Summary
 Object

          Applies a visitor to this type.
 boolean

          Obeys the general contract of java.lang.Object.equals.
 TypeKind

          Returns the of this type.
 int

          Obeys the general contract of java.lang.Object.hashCode.
 String

          Returns an informative string representation of this type.
 

Method Detail

accept

public Object accept(TypeVisitor v,
                     Object p)
Applies a visitor to this type.

Parameters:
v - the visitor operating on this type
p - additional parameter to the visitor
Returns:
a visitor-specified result

equals

public boolean equals(Object obj)
Obeys the general contract of {@link Object#equals Object.equals}. This method does not, however, indicate whether two types represent the same type. Semantic comparisons of type equality should instead use {@link Types#isSameType(TypeMirror, TypeMirror)}. The results of {@code t1.equals(t2)} and {@code Types.isSameType(t1, t2)} may differ.

Overrides:
equals in class Object
Parameters:
obj - the object to be compared with this type
Returns:
{@code true} if the specified object is equal to this one

getKind

public TypeKind getKind()
Returns the {@code kind} of this type.

Returns:
the kind of this type

hashCode

public int hashCode()
Obeys the general contract of {@link Object#hashCode Object.hashCode}.

Overrides:
hashCode in class Object

toString

public String toString()
Returns an informative string representation of this type. If possible, the string should be of a form suitable for representing this type in source code. Any names embedded in the result are qualified if possible.

Overrides:
toString in class Object
Returns:
a string representation of this type


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.