org.sourceflow.java
Class JavaInterface

java.lang.Object
  extended byorg.sourceflow.CodeElement
      extended byorg.sourceflow.CodeContainer
          extended byorg.sourceflow.java.JavaType
              extended byorg.sourceflow.java.JavaInterface
All Implemented Interfaces:
java.lang.Comparable

public class JavaInterface
extends JavaType

A class generating a Java interface declaration.


Field Summary
static int PACKAGE_LOCAL
          The package local access modifier constant (i.e. no modifier).
static int PRIVATE
          The private access modifier constant.
static int PROTECTED
          The protected access modifier constant.
static int PUBLIC
          The public access modifier constant.
static int STATIC
          The static modifier constant.
static int STRICTFP
          The strictfp modifier constant.
 
Constructor Summary
JavaInterface(int modifiers, java.lang.String name)
          Creates a new interface code generator with the specified access modifier.
JavaInterface(int modifiers, java.lang.String name, java.lang.String extendType)
          Creates a new class code generator with the specified access modifier that extends the specified class.
JavaInterface(java.lang.String name)
          Creates a new interface code generator with a public access modifier.
 
Method Summary
 void addMethod(JavaMethod member)
          Adds a method declaration to the interface.
 void addVariable(JavaVariable member)
          Adds a variable to the interface.
 int category()
          Returns a numeric category number for the code element.
 void print(java.io.PrintWriter out, CodeStyle style, int indent)
          Prints the code element to the specified output stream.
 
Methods inherited from class org.sourceflow.java.JavaType
addComment, print, toString
 
Methods inherited from class org.sourceflow.CodeContainer
addElement, printContents, size
 
Methods inherited from class org.sourceflow.CodeElement
compareTo, printSeparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PUBLIC

public static final int PUBLIC
The public access modifier constant.

See Also:
Constant Field Values

PROTECTED

public static final int PROTECTED
The protected access modifier constant. May only be used when declared inside a class.

See Also:
Constant Field Values

PACKAGE_LOCAL

public static final int PACKAGE_LOCAL
The package local access modifier constant (i.e. no modifier).

See Also:
Constant Field Values

PRIVATE

public static final int PRIVATE
The private access modifier constant. May only be used when declared inside a class.

See Also:
Constant Field Values

STATIC

public static final int STATIC
The static modifier constant. May only be used when declared inside a class.

See Also:
Constant Field Values

STRICTFP

public static final int STRICTFP
The strictfp modifier constant.

See Also:
Constant Field Values
Constructor Detail

JavaInterface

public JavaInterface(java.lang.String name)
Creates a new interface code generator with a public access modifier.

Parameters:
name - the class name

JavaInterface

public JavaInterface(int modifiers,
                     java.lang.String name)
Creates a new interface code generator with the specified access modifier.

Parameters:
modifiers - the modifier constant flags
name - the class name

JavaInterface

public JavaInterface(int modifiers,
                     java.lang.String name,
                     java.lang.String extendType)
Creates a new class code generator with the specified access modifier that extends the specified class.

Parameters:
modifiers - the modifier constant flags
name - the class name
extendType - the type to extend
Method Detail

addMethod

public void addMethod(JavaMethod member)
Adds a method declaration to the interface.

Parameters:
member - the member to add

addVariable

public void addVariable(JavaVariable member)
Adds a variable to the interface.

Parameters:
member - the member to add

category

public int category()
Returns a numeric category number for the code element. A lower category number implies that the code element should be placed before code elements with a higher category number within a declaration.

Specified by:
category in class CodeElement
Returns:
the category number

print

public void print(java.io.PrintWriter out,
                  CodeStyle style,
                  int indent)
Prints the code element to the specified output stream.

Specified by:
print in class CodeElement
Parameters:
out - the output stream
style - the code style to use
indent - the indentation level