org.sourceflow.visualbasic
Class VisualBasicType

java.lang.Object
  extended byorg.sourceflow.CodeElement
      extended byorg.sourceflow.CodeContainer
          extended byorg.sourceflow.visualbasic.VisualBasicType
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
VisualBasicClass, VisualBasicEnumeration

public abstract class VisualBasicType
extends CodeContainer

An abstract superclass for the various Visual Basic type code generators.


Field Summary
protected  VisualBasicComment comment
          The type comment.
protected  java.lang.String[] extendTypes
          The names of the types that this type extends and/or implements.
protected  int modifiers
          The type modifier flags.
protected  java.lang.String name
          The type name.
 
Constructor Summary
protected VisualBasicType(int modifiers, java.lang.String name, java.lang.String extendType)
          Creates a new type code generator with the specified access modifier that extends a specified type.
protected VisualBasicType(int modifiers, java.lang.String name, java.lang.String[] extendTypes)
          Creates a new type code generator with the specified access modifier that extends a specified type.
 
Method Summary
 void addComment(VisualBasicComment comment)
          Sets the type comment.
protected  void print(java.io.PrintWriter out, CodeStyle style, int indent, java.lang.String type, boolean compact)
          Prints the type to the specified stream.
 java.lang.String toString()
          Returns the type name.
 
Methods inherited from class org.sourceflow.CodeContainer
addElement, printContents, size
 
Methods inherited from class org.sourceflow.CodeElement
category, compareTo, print, printSeparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

modifiers

protected int modifiers
The type modifier flags.


name

protected java.lang.String name
The type name.


extendTypes

protected java.lang.String[] extendTypes
The names of the types that this type extends and/or implements.


comment

protected VisualBasicComment comment
The type comment.

Constructor Detail

VisualBasicType

protected VisualBasicType(int modifiers,
                          java.lang.String name,
                          java.lang.String extendType)
Creates a new type code generator with the specified access modifier that extends a specified type. If the extend type null or "" is specified, no extends declaration will be printed.

Parameters:
modifiers - the modifier flag constants
name - the type name
extendType - the type to extend and/or implement

VisualBasicType

protected VisualBasicType(int modifiers,
                          java.lang.String name,
                          java.lang.String[] extendTypes)
Creates a new type code generator with the specified access modifier that extends a specified type.

Parameters:
modifiers - the modifier flag constants
name - the type name
extendTypes - the types to extend and/or implement
Method Detail

toString

public java.lang.String toString()
Returns the type name.

Returns:
the type name

addComment

public void addComment(VisualBasicComment comment)
Sets the type comment. This method will remove any previous type comment.

Parameters:
comment - the new type comment

print

protected void print(java.io.PrintWriter out,
                     CodeStyle style,
                     int indent,
                     java.lang.String type,
                     boolean compact)
Prints the type to the specified stream.

Parameters:
out - the output stream
style - the code style to use
indent - the indentation level
type - the type name
compact - the compact printing flag