Org.SourceFlow
Class CodeElement
IComparable
|
+--CodeElement
in CodeElement.cs
- Direct Known Subclasses:
- CodeContainer, CComment, CFunction, CInclude, CTypedef, CVariable, CSharpComment, CSharpConstructor, CSharpMethod, CSharpUsing, CSharpVariable, Constant, JavaComment, JavaConstructor, JavaImport, JavaMethod, JavaPackage, JavaVariable, Constant, VisualBasicComment, VisualBasicConstructor, VisualBasicImports, VisualBasicMethod, VisualBasicVariable
- public abstract class CodeElement
- extends IComparable
The abstract base class for all code elements. The code
element classes handles some source code construct and allows
printing and comparing it to other constructs.
|
Field Summary |
abstract int |
Category
Returns a numeric category number for the code element. |
|
Method Summary |
virtual int |
CompareTo( object obj )
Compares this object to another one. |
abstract void |
Print( StreamWriter output, CodeStyle style, int indent )
Prints the code element to the specified output stream. |
protected internal virtual void |
PrintSeparator( StreamWriter output, CodeElement prev )
Prints a separator line between this element and the
previous element in a container. |
Category
public abstract 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.
- Returns:
- the category number
CompareTo
public virtual int CompareTo( object obj );
-
Compares this object to another one. The comparison is
based on the code element category, reporting equality
between elements within the same category. Objects not
being code elements will cause zero (0) to be returned.
- Parameters:
obj - the object to compare to
- Returns:
- negative if this object preceeds the other one,
zero (0) if the objects are equal, or
positive if this object succeeds the other one
Print
public abstract void Print( StreamWriter output, CodeStyle style, int indent );
-
Prints the code element to the specified output stream.
- Parameters:
output - the output stream
style - the code style to use
indent - the indentation level
PrintSeparator
protected internal virtual void PrintSeparator( StreamWriter output, CodeElement prev );
-
Prints a separator line between this element and the
previous element in a container. This method will NOT be
called for the first element in a container, as it has no
previous element. By default this method prints a single
newline.
- Parameters:
output - the output stream
prev - the previous code element