libjava/ChangeLog:
[official-gcc.git] / libjava / classpath / tools / gnu / classpath / tools / gjdoc / TypeVariableImpl.java
blob4524ab169bf07f5dd33bbf5fd63d963ec027a113
1 /* gnu.classpath.tools.gjdoc.TypeVariableImpl
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
21 package gnu.classpath.tools.gjdoc;
23 import com.sun.javadoc.ProgramElementDoc;
24 import com.sun.javadoc.Type;
25 import com.sun.javadoc.TypeVariable;
27 import java.util.List;
29 public class TypeVariableImpl
30 extends TypeImpl
31 implements TypeVariable, WritableType
34 /**
35 * The bounds of this particular type variable.
37 Type[] bounds;
39 /**
40 * The owning program element of this type variable.
42 ProgramElementDoc owner;
44 /**
45 * Constructs a new type variable with the supplied name and owner.
47 * @param packageName the name of the package containing the type variable.
48 * @param typeName the name of the type variable.
49 * @param dimension the dimensions of the type variable (always "").
50 * @param owner the owning program element of the type variable.
52 TypeVariableImpl(String packageName, String typeName, String dimension,
53 ProgramElementDoc owner)
55 super(packageName, typeName, dimension);
56 this.owner = owner;
59 /**
60 * Set the bounds to the contents of the supplied list.
62 * @param parsedBounds a list of type bounds.
64 void setBounds(List parsedBounds)
66 bounds = (Type[]) parsedBounds.toArray(new Type[parsedBounds.size()]);
69 /**
70 * Returns the bounds of this type variable.
72 * @return the bounds of the variable.
74 public Type[] bounds()
76 return bounds;
79 /**
80 * Returns the owning program element for this type variable.
82 * @return the owning program element, whether a class, interface,
83 * constructor or method.
85 public ProgramElementDoc owner()
87 return owner;