net.percederberg.grammatica.code.csharp
Class CSharpNamespace

java.lang.Object
  |
  +--net.percederberg.grammatica.code.CodeElement
        |
        +--net.percederberg.grammatica.code.CodeElementContainer
              |
              +--net.percederberg.grammatica.code.csharp.CSharpNamespace
All Implemented Interfaces:
java.lang.Comparable

public class CSharpNamespace
extends CodeElementContainer

A class generating a C# namespace declaration.

Version:
1.0
Author:
Per Cederberg,

Constructor Summary
CSharpNamespace(java.lang.String name)
          Creates a new namespace.
 
Method Summary
 void addClass(CSharpClass c)
          Adds a class declaration to the namespace.
 void addEnumeration(CSharpEnumeration e)
          Adds an enumeration to the namespace.
 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 net.percederberg.grammatica.code.CodeElementContainer
addElement, printContents, printSeparator
 
Methods inherited from class net.percederberg.grammatica.code.CodeElement
compareTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSharpNamespace

public CSharpNamespace(java.lang.String name)
Creates a new namespace.

Parameters:
name - the fully qualified namespace name
Method Detail

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

addClass

public void addClass(CSharpClass c)
Adds a class declaration to the namespace.

Parameters:
c - the class declaration to add

addEnumeration

public void addEnumeration(CSharpEnumeration e)
Adds an enumeration to the namespace.

Parameters:
e - the enumeration to add

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