org.sourceflow
Class CodeContainer

java.lang.Object
  extended byorg.sourceflow.CodeElement
      extended byorg.sourceflow.CodeContainer
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
CodeFile, CSharpNamespace, org.sourceflow.csharp.CSharpType, JavaType, VisualBasicNamespace, VisualBasicType

public abstract class CodeContainer
extends CodeElement

The abstract base class for all code element containers. The code element containers contains other code elements.


Constructor Summary
protected CodeContainer()
          Creates a new code element container.
 
Method Summary
protected  void addElement(CodeElement elem)
          Adds a code element to this container.
protected  void printContents(java.io.PrintWriter out, CodeStyle style, int indent)
          Prints all the contained code elements to the specified output stream.
protected  int size()
          Returns the number of content elements in this container.
 
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, toString, wait, wait, wait
 

Constructor Detail

CodeContainer

protected CodeContainer()
Creates a new code element container.

Method Detail

size

protected int size()
Returns the number of content elements in this container.

Returns:
the number of content elements in this container

addElement

protected void addElement(CodeElement elem)
Adds a code element to this container.

Parameters:
elem - the code element to add

printContents

protected void printContents(java.io.PrintWriter out,
                             CodeStyle style,
                             int indent)
Prints all the contained code elements to the specified output stream. The code elements will be sorted by their category numbers before printing.

Parameters:
out - the output stream
style - the code style to use
indent - the indentation level