ptolemy.copernicus.c
Class Utilities

java.lang.Object
  extended by ptolemy.copernicus.c.Utilities

public class Utilities
extends java.lang.Object

This class provides basic utilities used across a variety of classes.

Since:
Ptolemy II 2.0
Version:
$Id: Utilities.java,v 1.12 2005/07/08 19:57:00 cxh Exp $
Author:
Ankush Varma
Accepted Rating:
Red (ssb)
Proposed Rating:
Red (ankush)

Constructor Summary
Utilities()
           
 
Method Summary
static java.lang.String comment(java.lang.String text)
          Enclose a given string of text within appropriate delimiters to form a comment in the generated code.
static java.lang.String indent(int level)
          Return a string that generates an indentation string (a sequence of spaces) for the given indentation level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utilities

public Utilities()
Method Detail

comment

public static java.lang.String comment(java.lang.String text)
Enclose a given string of text within appropriate delimiters to form a comment in the generated code. Also, append a new line after the comment.

Parameters:
text - The text to place in the generated comment.
Returns:
The generated comment. Standard ANSI C comments are used here.

indent

public static java.lang.String indent(int level)
Return a string that generates an indentation string (a sequence of spaces) for the given indentation level. Each indentation level unit is four characters wide.

Parameters:
level - The indentation level.
Returns:
The indentation string that corresponds to the given indentation level.