1 34 35 package net.percederberg.grammatica.code.visualbasic; 36 37 import java.io.PrintWriter ; 38 39 import net.percederberg.grammatica.code.CodeElement; 40 import net.percederberg.grammatica.code.CodeStyle; 41 42 50 public class VisualBasicClass extends VisualBasicType { 51 52 55 public static final int PUBLIC = VisualBasicModifier.PUBLIC; 56 57 61 public static final int PROTECTED_FRIEND = 62 VisualBasicModifier.PROTECTED_FRIEND; 63 64 68 public static final int PROTECTED = VisualBasicModifier.PROTECTED; 69 70 73 public static final int FRIEND = VisualBasicModifier.FRIEND; 74 75 79 public static final int PRIVATE = VisualBasicModifier.PRIVATE; 80 81 84 public static final int MUST_INHERIT = VisualBasicModifier.MUST_INHERIT; 85 86 89 public static final int NOT_INHERITABLE = 90 VisualBasicModifier.NOT_INHERITABLE; 91 92 96 public static final int SHADOWS = VisualBasicModifier.SHADOWS; 97 98 104 public VisualBasicClass(String name) { 105 this(PUBLIC, name); 106 } 107 108 115 public VisualBasicClass(int modifiers, String name) { 116 this(modifiers, name, ""); 117 } 118 119 127 public VisualBasicClass(int modifiers, String name, String extendsClass) { 128 super(modifiers, name, extendsClass); 129 } 130 131 140 public VisualBasicClass(int modifiers, 141 String name, 142 String [] extendClasses) { 143 144 super(modifiers, name, extendClasses); 145 } 146 147 155 public int category() { 156 return 10; 157 } 158 159 164 public void addClass(VisualBasicClass member) { 165 addElement(member); 166 } 167 168 173 public void addEnumeration(VisualBasicEnumeration member) { 174 addElement(member); 175 } 176 177 182 public void addConstructor(VisualBasicConstructor member) { 183 member.setVisualBasicClass(this); 184 addElement(member); 185 } 186 187 192 public void addMethod(VisualBasicMethod member) { 193 addElement(member); 194 } 195 196 203 public void print(PrintWriter out, CodeStyle style, int indent) { 204 print(out, style, indent, "Class"); 205 } 206 207 215 protected void printSeparator(PrintWriter out, 216 CodeStyle style, 217 CodeElement prev, 218 CodeElement next) { 219 220 if (next == null) { 221 } else { 223 out.println(); 224 } 225 } 226 } 227 | Popular Tags |