public final class SFIToolkit extends Object
Modifier and Type | Field and Description |
---|---|
static int |
RC_BREAK |
static int |
RC_GENERAL_ERROR |
static int |
RC_GENERAL_EXCEPTION |
static int |
RC_SYNTAX_ERROR |
Modifier and Type | Method and Description |
---|---|
static void |
callGC()
Call the Java garbage collector. Calling this method
should generally be avoided.
|
static void |
display(String s)
Output a string to the Stata Results window.
|
static void |
displayln(String s)
Output a string to the Stata Results window and automatically add
a line terminator at the end.
|
static void |
error(String s)
Output a string to the Stata Results window as an error.
|
static boolean |
errorDebug(String s)
Output a string to the Stata Results window as an error if
set debug on is enabled.
|
static void |
errorln(String s)
Output a string to the Stata Results window and automatically add
a line terminator at the end.
|
static int |
executeCommand(String command,
boolean echo)
Execute a Stata command.
|
static String |
formatValue(double val,
String format)
Format a value using a Stata format.
|
static double |
getCallerVersion()
Get the version number of the calling program.
|
static String |
getTempFile()
Get a valid Stata temporary filename.
|
static String |
getTempName()
Get a valid Stata temporary name.
|
static String |
getWorkingDir()
Get the current Stata working directory.
|
static boolean |
isValidName(String s)
Check if a
String is a valid Stata name. |
static boolean |
isValidVariableName(String s)
Check if a
String is a valid Stata variable name. |
static int |
pollnow()
Request that Stata poll its GUI immediately.
|
static int |
pollstd()
Request that Stata poll its GUI at the standard interval.
|
static String |
stackTraceToString(Exception e)
|
public static final int RC_GENERAL_EXCEPTION
public static final int RC_GENERAL_ERROR
public static final int RC_SYNTAX_ERROR
public static final int RC_BREAK
public static void display(String s)
s
- The string to output.public static void displayln(String s)
s
- The string to output.public static void error(String s)
s
- The string to output.public static void errorln(String s)
s
- The string to output.public static boolean errorDebug(String s)
s
- The string to output.public static int executeCommand(String command, boolean echo)
command
- The command to execute.echo
- Echo the command.public static int pollstd()
public static int pollnow()
pollstd
should be used instead.public static String getTempName()
public static String getTempFile()
public static String getWorkingDir()
public static boolean isValidName(String s)
String
is a valid Stata name.s
- Name to test.String
represents a valid Stata
name.public static boolean isValidVariableName(String s)
String
is a valid Stata variable name.s
- Name to test.String
represents a valid Stata
variable name.public static String formatValue(double val, String format)
public static double getCallerVersion()
public static String stackTraceToString(Exception e)
e
- ExceptionString
representation of the stack trace.public static void callGC()