Overview   Project   Class   Tree   Deprecated   Index 
SourceFlow 1.0.beta API Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

Org.SourceFlow.CSharp
Class CSharpMethod

IComparable
   |
   +--CodeElement
         |
         +--CSharpMethod

   in CSharpMethod.cs

public class CSharpMethod
extends CodeElement

A class generating a C# method declaration.


Field Summary
 const int ABSTRACT
          The abstract modifier constant.
 override int Category
          Returns a numeric category number for the code element.
 const int EXTERN
          The extern modifier constant.
 const int INTERNAL
          The internal access modifier constant.
 const int NEW
          The new modifier constant.
 const int OVERRIDE
          The override modifier constant.
 bool PrintCode
          Sets the print code flag.
 const int PRIVATE
          The private access modifier constant.
 const int PROTECTED
          The protected access modifier constant.
 const int PROTECTED_INTERNAL
          The protected internal access modifier constant.
 const int PUBLIC
          The public access modifier constant.
 const int SEALED
          The sealed modifier constant.
 const int STATIC
          The static modifier constant.
 const int VIRTUAL
          The virtual modifier constant.
   
Fields inherited from class CodeElement
Category
 
Constructor Summary
CSharpMethod( string name )
          Creates a new method with the specified name.
CSharpMethod( string name, string args )
          Creates a new method with the specified name and arguments.
CSharpMethod( string name, string args, string returnType )
          Creates a new method with the specified arguments.
CSharpMethod( int modifiers, string name, string args, string returnType )
          Creates a new method with the specified arguments.
 
Method Summary
 void AddCode( string codeLines )
          Adds one or more lines of actual code.
 void AddComment( CSharpComment comment )
          Sets a comment for this method.
 bool CanPrintCode()
          Checks if the method source code can the printed.
 override void Print( StreamWriter output, CodeStyle style, int indent )
          Prints the code element to the specified output stream.
 override string ToString()
          Returns the method name.
   
Methods inherited from class CodeElement
CompareTo, Print, PrintSeparator
 

Field Detail

ABSTRACT

public const int ABSTRACT;
The abstract modifier constant. Cannot be combined with private, static, virtual, sealed, or extern.

Category

public override 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

EXTERN

public const int EXTERN;
The extern modifier constant. Cannot be combined with abstract.

INTERNAL

public const int INTERNAL;
The internal access modifier constant.

NEW

public const int NEW;
The new modifier constant. Cannot be combined with override.

OVERRIDE

public const int OVERRIDE;
The override modifier constant. Cannot be combined with private, static, virtual, or new.

PrintCode

public bool PrintCode;
Sets the print code flag.

PRIVATE

public const int PRIVATE;
The private access modifier constant. Cannot be combined with virtual, override, or abstract.

PROTECTED

public const int PROTECTED;
The protected access modifier constant.

PROTECTED_INTERNAL

public const int PROTECTED_INTERNAL;
The protected internal access modifier constant.

PUBLIC

public const int PUBLIC;
The public access modifier constant.

SEALED

public const int SEALED;
The sealed modifier constant. Cannot be combined with abstract.

STATIC

public const int STATIC;
The static modifier constant. Cannot be combined with virtual, override, or abstract.

VIRTUAL

public const int VIRTUAL;
The virtual modifier constant. Cannot be combined with private, static, override, or abstract.


Constructor Detail

CSharpMethod

public CSharpMethod( string name );
Creates a new method with the specified name. The method will not take any arguments and will return void.
Parameters:
name - the method name

CSharpMethod

public CSharpMethod( string name, string args );
Creates a new method with the specified name and arguments. The method will return void.
Parameters:
name - the method name
args - the argument list, excluding parenthesis

CSharpMethod

public CSharpMethod( string name, string args, string returnType );
Creates a new method with the specified arguments.
Parameters:
name - the method name
args - the argument list, excluding parenthesis
returnType - the return type

CSharpMethod

public CSharpMethod( int modifiers, string name, string args, string returnType );
Creates a new method with the specified arguments.
Parameters:
modifiers - the modifier flags to use
name - the method name
args - the argument list, excluding parenthesis
returnType - the return type


Method Detail

AddCode

public void AddCode( string codeLines );
Adds one or more lines of actual code.
Parameters:
codeLines - the lines of Java code to add

AddComment

public void AddComment( CSharpComment comment );
Sets a comment for this method.
Parameters:
comment - the new method comment

CanPrintCode

public bool CanPrintCode();
Checks if the method source code can the printed. This method will return false if the method is abstract or if the print code flag is set to false.
Returns:
true if method source code can be printed, or false otherwise

Print

public override 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

ToString

public override string ToString();
Returns the method name.
Returns:
the method name

 Overview   Project   Class   Tree   Deprecated   Index 
SourceFlow 1.0.beta API Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD