01: /*
02: * xtc - The eXTensible Compiler
03: * Copyright (C) 2005-2007 Robert Grimm
04: *
05: * This program is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU General Public License
07: * version 2 as published by the Free Software Foundation.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17: * USA.
18: */
19: package xtc.type;
20:
21: import java.util.List;
22:
23: /**
24: * A method type.
25: *
26: * @author Robert Grimm
27: * @version $Revision: 1.12 $
28: */
29: public class MethodT extends FunctionOrMethodT {
30:
31: /**
32: * Create a new method type.
33: *
34: * @param result The result type.
35: * @param name The name.
36: * @param parameters The list of parameter types.
37: * @param varargs The flag for accepting a variable number of
38: * arguments.
39: * @param exceptions The list of exceptions, which must not be
40: * <code>null</code>
41: */
42: public MethodT(Type result, String name, List<Type> parameters,
43: boolean varargs, List<Type> exceptions) {
44: super (null, result, name, parameters, varargs, exceptions);
45: }
46:
47: /**
48: * Create a new method type.
49: *
50: * @param template The type whose annotations to copy.
51: * @param result The result type.
52: * @param name The name.
53: * @param parameters The list of parameter types.
54: * @param varargs The flag for accepting a variable number of
55: * arguments.
56: * @param exceptions The list of exceptions, which must not be
57: * <code>null</code>
58: */
59: public MethodT(Type template, Type result, String name,
60: List<Type> parameters, boolean varargs,
61: List<Type> exceptions) {
62: super (template, result, name, parameters, varargs, exceptions);
63: }
64:
65: public MethodT copy() {
66: return new MethodT(this , result.copy(), name, copy(parameters),
67: varargs, copy(exceptions));
68: }
69:
70: public Type.Tag tag() {
71: return Type.Tag.METHOD;
72: }
73:
74: public boolean isMethod() {
75: return true;
76: }
77:
78: public MethodT toMethod() {
79: return this;
80: }
81:
82: }
|