1 /* 2 * @(#)TypeMirror.java 1.3 04/07/16 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package com.sun.mirror.type; 9 10 11 import com.sun.mirror.declaration.Declaration; 12 import com.sun.mirror.util.Types; 13 import com.sun.mirror.util.TypeVisitor; 14 15 16 /** 17 * Represents a type in the Java programming language. 18 * Types include primitive types, class and interface types, array 19 * types, and type variables. Wildcard type arguments, and the 20 * pseudo-type representing the type of <tt>void</tt>, are represented 21 * by type mirrors as well. 22 * 23 * <p> Types may be compared using the utility methods in 24 * {@link Types}. 25 * There is no guarantee that any particular type will 26 * always be represented by the same object. 27 * 28 * @author Joseph D. Darcy 29 * @author Scott Seligman 30 * @version 1.3 04/07/16 31 * 32 * @see Declaration 33 * @see Types 34 * @since 1.5 35 */ 36 37 public interface TypeMirror { 38 39 /** 40 * Returns a string representation of this type. 41 * Any names embedded in the expression are qualified. 42 * 43 * @return a string representation of this type 44 */ 45 String toString(); 46 47 /** 48 * Tests whether two types represent the same type. 49 * 50 * @param obj the object to be compared with this type 51 * @return <tt>true</tt> if the specified object represents the same 52 * type as this. 53 */ 54 boolean equals(Object obj); 55 56 /** 57 * Applies a visitor to this type. 58 * 59 * @param v the visitor operating on this type 60 */ 61 void accept(TypeVisitor v); 62 } 63