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.io.IOException;
22:
23: import java.util.List;
24:
25: /**
26: * An interface type.
27: *
28: * @author Robert Grimm
29: * @version $Revision: 1.12 $
30: */
31: public class InterfaceT extends ClassOrInterfaceT {
32:
33: /**
34: * Create a new interface type.
35: *
36: * @param qname The fully qualified name.
37: * @param interfaces The list of extended interfaces.
38: * @param fields The list of fields.
39: * @param methods The list of methods.
40: */
41: public InterfaceT(String qname, List<Type> interfaces,
42: List<Type> fields, List<Type> methods) {
43: super (null, qname, interfaces, fields, methods);
44: }
45:
46: /**
47: * Create a new interface type.
48: *
49: * @param template The type whose annotations to copy.
50: * @param qname The fully qualified name.
51: * @param interfaces The list of extended interfaces.
52: * @param fields The list of fields.
53: * @param methods The list of methods.
54: */
55: public InterfaceT(Type template, String qname,
56: List<Type> interfaces, List<Type> fields, List<Type> methods) {
57: super (template, qname, interfaces, fields, methods);
58: }
59:
60: public InterfaceT copy() {
61: return new InterfaceT(this , qname, copy(interfaces),
62: copy(fields), copy(methods));
63: }
64:
65: public Type.Tag tag() {
66: return Type.Tag.INTERFACE;
67: }
68:
69: public boolean isInterface() {
70: return true;
71: }
72:
73: public InterfaceT toInterface() {
74: return this ;
75: }
76:
77: public void write(Appendable out) throws IOException {
78: out.append("interface ");
79: out.append(qname);
80: }
81:
82: }
|