org.sourceflow.java
Class JavaType

java.lang.Object
  extended byorg.sourceflow.CodeElement
      extended byorg.sourceflow.CodeContainer
          extended byorg.sourceflow.java.JavaType
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
JavaClass, JavaInterface

public abstract class JavaType
extends CodeContainer

An abstract superclass for the Java class and interface code generators.


Constructor Summary
protected JavaType(int modifiers, java.lang.String name, java.lang.String extendsType, java.lang.String implementType)
          Creates a new type code generator.
protected JavaType(int modifiers, java.lang.String name, java.lang.String extendsType, java.lang.String[] implementTypes)
          Creates a new type code generator.
 
Method Summary
 void addComment(JavaComment comment)
          Adds a comment to this type.
protected  void print(java.io.PrintWriter out, CodeStyle style, int indent, java.lang.String type)
          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
 

Constructor Detail

JavaType

protected JavaType(int modifiers,
                   java.lang.String name,
                   java.lang.String extendsType,
                   java.lang.String implementType)
Creates a new type code generator.

Parameters:
modifiers - the modifier constant flags
name - the type name
extendsType - the class or interface to extend
implementType - the class or interface to implement

JavaType

protected JavaType(int modifiers,
                   java.lang.String name,
                   java.lang.String extendsType,
                   java.lang.String[] implementTypes)
Creates a new type code generator.

Parameters:
modifiers - the modifier constant flags
name - the type name
extendsType - the class or interface to extend
implementTypes - the classes or interfaces to implement
Method Detail

toString

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

Returns:
the type name

addComment

public void addComment(JavaComment comment)
Adds a comment to this type.

Parameters:
comment - the new type comment

print

protected void print(java.io.PrintWriter out,
                     CodeStyle style,
                     int indent,
                     java.lang.String type)
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 (i.e. "class" or "interface")