From: brian Date: Tue, 1 Jun 2004 06:19:46 +0000 (+0000) Subject: interface support X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b0c281117174062552c6470cc78b565163748a4d;p=org.ibex.classgen.git interface support darcs-hash:20040601061946-24bed-429e934ef9871d89e27b27a4b76167ec004b9d8a.gz --- diff --git a/src/org/ibex/classgen/ClassGen.java b/src/org/ibex/classgen/ClassGen.java index d579b99..1b5e15e 100644 --- a/src/org/ibex/classgen/ClassGen.java +++ b/src/org/ibex/classgen/ClassGen.java @@ -7,10 +7,10 @@ import java.io.*; public class ClassGen implements CGConst { private final Type.Object thisType; private final Type.Object superType; + private final Type.Object[] interfaces; final int flags; private String sourceFile; - private final Vector interfaces = new Vector(); private final Vector fields = new Vector(); private final Vector methods = new Vector(); @@ -21,17 +21,23 @@ public class ClassGen implements CGConst { public ClassGen(String name, String superName, int flags) { this(new Type.Object(name),new Type.Object(superName),flags); } + + /** @see #ClassGen(Type.Object,Type.Object,int,Type.Object[]) */ + public ClassGen(Type.Object thisType,Type.Object superType, int flags) { + this(thisType,superType,flags,null); + } /** Creates a new ClassGen object @param thisType The type of the class to generate - @param superType The superclas of the generated class (commonly Type.OBJECT) + @param superType The superclass of the generated class (commonly Type.OBJECT) @param flags The access flags for this class (ACC_PUBLIC, ACC_FINAL, ACC_SUPER, ACC_INTERFACE, and ACC_ABSTRACT) */ - public ClassGen(Type.Object thisType,Type.Object superType, int flags) { + public ClassGen(Type.Object thisType,Type.Object superType, int flags, Type.Object[] interfaces) { if((flags & ~(ACC_PUBLIC|ACC_FINAL|ACC_SUPER|ACC_INTERFACE|ACC_ABSTRACT)) != 0) throw new IllegalArgumentException("invalid flags"); this.thisType = thisType; this.superType = superType; + this.interfaces = interfaces; this.flags = flags; cp = new CPGen(); @@ -113,7 +119,7 @@ public class ClassGen implements CGConst { private void _dump(DataOutput o) throws IOException { cp.add(thisType); cp.add(superType); - for(int i=0;i