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