net.percederberg.grammatica.code
Class CodeElementContainer
java.lang.Object
|
+--net.percederberg.grammatica.code.CodeElement
|
+--net.percederberg.grammatica.code.CodeElementContainer
- All Implemented Interfaces:
- java.lang.Comparable
- Direct Known Subclasses:
- CSharpFile, CSharpNamespace, net.percederberg.grammatica.code.csharp.CSharpType, JavaFile, net.percederberg.grammatica.code.java.JavaType
- public abstract class CodeElementContainer
- extends CodeElement
The abstract base class for all code element containers. The code
element containers contains other code elements.
- Version:
- 1.0
- Author:
- Per Cederberg,
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CodeElementContainer
public CodeElementContainer()
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
number before printing.
- Parameters:
out
- the output streamstyle
- the code style to useindent
- the indentation level
printSeparator
protected void printSeparator(java.io.PrintWriter out,
CodeStyle style,
CodeElement prev,
CodeElement next)
- Prints the lines separating two elements. By default this
method prints a newline before the first element, and between
elements with different category numbers.
- Parameters:
out
- the output streamstyle
- the code style to useprev
- the previous element, or null if firstnext
- the next element, or null if last