diff options
Diffstat (limited to 'java/JACE/OS')
-rw-r--r-- | java/JACE/OS/ACE.java | 156 | ||||
-rw-r--r-- | java/JACE/OS/OS.java | 65 | ||||
-rw-r--r-- | java/JACE/OS/package.html | 6 |
3 files changed, 0 insertions, 227 deletions
diff --git a/java/JACE/OS/ACE.java b/java/JACE/OS/ACE.java deleted file mode 100644 index 3979fa6c2d2..00000000000 --- a/java/JACE/OS/ACE.java +++ /dev/null @@ -1,156 +0,0 @@ -/************************************************* - * - * = PACKAGE - * JACE.OS - * - * = FILENAME - * JACE.java - * - *@author Prashant Jain - * - *************************************************/ -package JACE.OS; - -/** - * Constants, utility "functions", etc. - * <P> - * Defines default constants for ACE. Many of these are used for the - * ACE tests and applications. You may want to change some of these to - * correspond to your environment. Also, routines for error handling, - * debugging and bit manipulation are included. - * <P> - * This class is non-instantiable, and intended only to provide a constrained - * namespace. - */ -public abstract class ACE -{ - /** - * Default port on which a server listens for connections. - */ - public static final int DEFAULT_SERVER_PORT = 10002; - - /** - * Default name to use for a thread group. - */ - public static final String DEFAULT_THREAD_GROUP_NAME = "ace_thread_group"; - - /** - * Disable debugging. Once debugging is disabled, all ACE.DEBUG - * statements would be ignored. - */ - public static final void disableDebugging () - { - ACE.debug_ = false; - } - - /** - * Enable debugging. Once debugging is enabled, all ACE.DEBUG - * statements get printed. - */ - public static final void enableDebugging () - { - ACE.debug_ = true; - } - - /** - * Print the string representation of Java Exception. - *@param e Java exception - */ - public static final void ERROR (Exception e) - { - System.err.println (e); - } - - /** - * Print the string being passed in. - *@param s a Java String - */ - public static final void ERROR (String s) - { - System.err.println (s); - } - - /** - * Print the string being passed in. - *@param s A Java String - *@return Error value passed in - */ - public static final int ERROR_RETURN (String s, int errorVal) - { - System.err.println (s); - return errorVal; - } - - /** - * Print the string being passed in. Note the behavior will vary - * depending upon whether debugging is enabled or disabled. - *@param s a Java String - */ - public static final void DEBUG (String s) - { - if (ACE.debug_) - System.out.println (s); - } - - /** - * Flush out any data that may be buffered. - */ - public static final void FLUSH () - { - System.out.flush (); - } - - /** - * Set the bits of WORD using BITS as the mask. - *@param WORD the bits to be set. - *@param BITS the mask to use. - *@return The value obtained after setting the bits. - */ - public static final long SET_BITS (long WORD, long BITS) - { - return WORD | BITS; - } - - /** - * Clear the bits of WORD using BITS as the mask. - *@param WORD the bits to clear. - *@param BITS the mask to use. - *@return The value obtained after clearing the bits. - */ - public static final long CLR_BITS (long WORD, long BITS) - { - return WORD & ~BITS; - } - - /** - * Check if bits are enabled in WORD. - *@param WORD the bits to check. - *@param BIT the bit to check to see if it is enabled or not. - *@return true if bit is enabled, false otherwise. - */ - public static final boolean BIT_ENABLED (long WORD, long BIT) - { - return (WORD & BIT) != 0; - } - - /** - * Check if bits are disabled in WORD. - *@param WORD the bits to check. - *@param BIT the bit to check to see if it is disabled or not. - *@return true if bit is disabled, false otherwise. - */ - public static final boolean BIT_DISABLED (long WORD, long BIT) - { - return (WORD & BIT) == 0; - } - - // Debug flag (turn debugging on/off) - private static boolean debug_ = false; - - // Default private constructor to avoid instantiation - private ACE () - { - } -} - - diff --git a/java/JACE/OS/OS.java b/java/JACE/OS/OS.java deleted file mode 100644 index 3f15a028cc2..00000000000 --- a/java/JACE/OS/OS.java +++ /dev/null @@ -1,65 +0,0 @@ -/************************************************* - * - * = PACKAGE - * JACE.OS - * - * = FILENAME - * OS.java - * - *@author Prashant Jain - * - *************************************************/ -package JACE.OS; - -import java.util.StringTokenizer; - -/** - * Methods to extend the capabilities of the Java runtime system. - * <P> - * This non-instantiable class contains little <q>utility functions</q> - * that should have been in Java to begin with :-) - */ -public class OS -{ - /** - * Create an array of Strings from a single String using <delim> as - * the delimiter. - *@param args the String to break up to make an array of Strings - *@param delim the delimeter to use to break the String up - *@return an array containing the original String broken up - */ - public static String [] createStringArray (String args, String delim) - { - // First determine the number of arguments - int count = 0; - StringTokenizer tokens = new StringTokenizer (args, delim); - while (tokens.hasMoreTokens ()) - { - tokens.nextToken (); - count++; - } - if (count == 0) - return null; - - // Create argument array - String [] argArray = new String [count]; - int index = 0; - tokens = new StringTokenizer (args, " "); - while (tokens.hasMoreTokens ()) - { - argArray [index] = tokens.nextToken (); - index++; - } - - // Assert index == count - if (index != count) - return null; - else - return argArray; - } - - // Default private constructor to avoid instantiation - private OS () - { - } -} diff --git a/java/JACE/OS/package.html b/java/JACE/OS/package.html deleted file mode 100644 index 01245ef0b51..00000000000 --- a/java/JACE/OS/package.html +++ /dev/null @@ -1,6 +0,0 @@ -<!-- $Id$ --> -<HTML> -<BODY> -Extensions to the Java runtime system. -</BODY> -</HTML> |