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