/[classpath]/classpath/java/lang/reflect/ParameterizedType.java
ViewVC logotype

Diff of /classpath/java/lang/reflect/ParameterizedType.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.1 by tromey, Fri Aug 27 00:05:03 2004 UTC revision 1.1.2.2 by gnu_andrew, Sun Feb 20 21:10:36 2005 UTC
# Line 1  Line 1 
1  /* ParameterizedType.java  /* ParameterizedType.java -- Represents parameterized types e.g. List<String>
2     Copyright (C) 2004 Free Software Foundation, Inc.     Copyright (C) 2004, 2005 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package java.lang.reflect;  package java.lang.reflect;
40    
41  public interface ParameterizedType extends Type  /**
42     * <p>
43     * Represents a type which is parameterized over one or more other
44     * types.  For example, <code>List&lt;Integer&gt;</code> is a parameterized
45     * type, with <code>List</code> parameterized over the type
46     * <code>Integer</code>.
47     * </p>
48     * <p>
49     * Instances of this classes are created as needed, during reflection.
50     * On creating a parameterized type, <code>p</code>, the
51     * <code>GenericTypeDeclaration</code> corresponding to <code>p</code>
52     * is created and resolved.  Each type argument of <code>p</code>
53     * is then created recursively; details of this process are availble
54     * in the documentation of <code>TypeVariable</code>.  This creation
55     * process only happens once; repetition has no effect.
56     * </p>
57     * <p>
58     * Implementors of this interface must implement an appropriate
59     * <code>equals()</code> method.  This method should equate any
60     * two instances of the implementing class that have the same
61     * <code>GenericTypeDeclaration</code> and <code>Type</code>
62     * parameters.
63     *
64     * @author Tom Tromey (tromey@redhat.com)
65     * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
66     * @see GenericTypeDeclaration
67     * @see TypeVariable
68     * @since 1.5
69     */
70    public interface ParameterizedType
71      extends Type
72  {  {
73    
74      /**
75       * <p>
76       * Returns an array of <code>Type</code> objects, which gives
77       * the parameters of this type.
78       * </p>
79       * <p>
80       * <strong>Note</code>: the returned array may be empty.  This
81       * occurs if the supposed <code>ParameterizedType</code> is simply
82       * a normal type wrapped inside a parameterized type.
83       * </p>
84       *
85       * @return an array of <code>Type</code>s, representing the arguments
86       *         of this type.
87       * @throws TypeNotPresentException if any of the types referred to by
88       *         the parameters of this type do not actually exist.
89       * @throws MalformedParameterizedTypeException if any of the types
90       *         refer to a type which can not be instantiated.
91       */
92    Type[] getActualTypeArguments();    Type[] getActualTypeArguments();
93    
94      /**
95       * Returns the type of which this type is a member.  For example,
96       * in <code>Top&lt;String&gt;.Bottom&lt;Integer&gt;</code>,
97       * <code>Bottom&lt;Integer&gt;</code> is a member of
98       * <code>Top&lt;String&gt;</code>, and so the latter is returned
99       * by this method.  Calling this method on top-level types (such as
100       * <code>Top&lt;String&gt;</code>) returns null.
101       *
102       * @return the type which owns this type.
103       * @throws TypeNotPresentException if the owner type referred to by
104       *         this type do not actually exist.
105       * @throws MalformedParameterizedTypeException if the owner type
106       *         referred to by this type can not be instantiated.
107       */
108    Type getOwnerType();    Type getOwnerType();
109    
110      /**
111       * Returns a version of this type without parameters, which corresponds
112       * to the class or interface which declared the type.  For example,
113       * the raw type corresponding to <code>List&lt;Double&gt;</code>
114       * is <code>List</code>, which was declared by the <code>List</code>
115       * class.
116       *
117       * @return the raw variant of this type (i.e. the type without
118       *         parameters).
119       */
120    Type getRawType();    Type getRawType();
121    
122  }  }

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26