1. /*
  2. * @(#)ParameterizedType.java 1.5 04/04/30
  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.javadoc;
  9. /**
  10. * Represents an invocation of a generic class or interface. For example,
  11. * given the generic interface {@code List<E>}, possible invocations
  12. * include:
  13. * <pre>
  14. * {@code List<String>}
  15. * {@code List<T extends Number>}
  16. * {@code List<?>}
  17. * </pre>
  18. * A generic inner class {@code Outer<T>.Inner<S>} might be invoked as:
  19. * <pre>
  20. * {@code Outer<Number>.Inner<String>}
  21. * </pre>
  22. *
  23. * @author Scott Seligman
  24. * @version 1.5 04/04/30
  25. * @since 1.5
  26. */
  27. public interface ParameterizedType extends Type {
  28. /**
  29. * Return the generic class or interface that declared this type.
  30. *
  31. * @return the generic class or interface that declared this type.
  32. */
  33. ClassDoc asClassDoc();
  34. /**
  35. * Return the actual type arguments of this type.
  36. * For a generic type that is nested within some other generic type
  37. * (such as {@code Outer<T>.Inner<S>}),
  38. * only the type arguments of the innermost type are included.
  39. *
  40. * @return the actual type arguments of this type.
  41. */
  42. Type[] typeArguments();
  43. /**
  44. * Return the class type that is a direct supertype of this one.
  45. * This is the superclass of this type's declaring class,
  46. * with type arguments substituted in.
  47. * Return null if this is an interface type.
  48. *
  49. * <p> For example, if this parameterized type is
  50. * {@code java.util.ArrayList<String>}, the result will be
  51. * {@code java.util.AbstractList<String>}.
  52. *
  53. * @return the class type that is a direct supertype of this one.
  54. */
  55. Type superclassType();
  56. /**
  57. * Return the interface types directly implemented by or extended by this
  58. * parameterized type.
  59. * These are the interfaces directly implemented or extended
  60. * by this type's declaring class or interface,
  61. * with type arguments substituted in.
  62. * Return an empty array if there are no interfaces.
  63. *
  64. * <p> For example, the interface extended by
  65. * {@code java.util.Set<String>} is {@code java.util.Collection<String>}.
  66. *
  67. * @return the interface types directly implemented by or extended by this
  68. * parameterized type.
  69. */
  70. Type[] interfaceTypes();
  71. /**
  72. * Return the type that contains this type as a member.
  73. * Return null is this is a top-level type.
  74. *
  75. * <p> For example, the containing type of
  76. * {@code AnInterface.Nested<Number>} is the <code>ClassDoc</code>
  77. * representing {@code AnInterface}, and the containing type of
  78. * {@code Outer<String>.Inner<Number>} is the
  79. * <code>ParameterizedType</code> representing {@code Outer<String>}.
  80. *
  81. * @return the type that contains this type as a member.
  82. */
  83. Type containingType();
  84. }