com.novell.nds.dirxml.driver.xds.util
Class Java

java.lang.Object
  extended bycom.novell.nds.dirxml.driver.xds.util.Java

public abstract class Java
extends Object

A library of Java helper methods.


Field Summary
static Hashtable EMPTY_HASH_TABLE
          An empty Hashtable.
static String EMPTY_STRING
          Empty string.
static int END_OF_STREAM
          The value returnd for end-of-stream.
static int EQUAL
          The value returned for equal from compare() methods.
static int INDEX_FIRST
          The first index in data structures.
static int INDEX_NOT_FOUND
          The value returned for not found from find() methods.
 
Constructor Summary
Java()
           
 
Method Summary
static StringBuffer clear(StringBuffer b)
          Clears the contents of a StringBuffer.
static Object getFirst(List l)
          Returns the fist Object in a List.
static boolean isJRE(int major, int minor)
          Is the Java Runtime Environment (JRE) >= the passed version information?
static boolean isJRE(int major, int minor1, int minor2, int rev1, int rev2)
          Is the Java Runtime Environment (JRE) >= the passed version information?
static boolean isNullOrEmpty(Collection c)
          Determies whether a Collection is null or empty?
static boolean isNullOrEmpty(Map m)
          Determines whether a Map is null or empty?
static boolean isNullOrZeroLength(byte[] bytes)
          Determines whether a byte[] is null or has a length of zero?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUAL

public static final int EQUAL
The value returned for equal from compare() methods.

See Also:
Constant Field Values

INDEX_FIRST

public static final int INDEX_FIRST
The first index in data structures.

See Also:
Constant Field Values

INDEX_NOT_FOUND

public static final int INDEX_NOT_FOUND
The value returned for not found from find() methods.

See Also:
Constant Field Values

END_OF_STREAM

public static final int END_OF_STREAM
The value returnd for end-of-stream.

See Also:
Constant Field Values

EMPTY_HASH_TABLE

public static final Hashtable EMPTY_HASH_TABLE
An empty Hashtable.


EMPTY_STRING

public static final String EMPTY_STRING
Empty string.

See Also:
Constant Field Values
Constructor Detail

Java

public Java()
Method Detail

isJRE

public static final boolean isJRE(int major,
                                  int minor)
Is the Java Runtime Environment (JRE) >= the passed version information?

Parameters:
major - the major version
minor - the minor version
Returns:
true or false

isJRE

public static final boolean isJRE(int major,
                                  int minor1,
                                  int minor2,
                                  int rev1,
                                  int rev2)
Is the Java Runtime Environment (JRE) >= the passed version information?

Parameters:
major - the major version (e.g., 1)
minor1 - the first minor version (e.g., 1.4)
minor2 - the second minor version (e.g., 1.4.2)
rev1 - the first revision number (e.g., 1.4.2_0)
rev2 - the second revision number (e.g., 1.4.2_08)
Returns:
true or false

getFirst

public static final Object getFirst(List l)
Returns the fist Object in a List.

Parameters:
l - the list; may be null
Returns:
may return null

isNullOrEmpty

public static final boolean isNullOrEmpty(Collection c)
Determies whether a Collection is null or empty?

Parameters:
c - the collection; may be null
Returns:
true if it is; false otherwise

isNullOrEmpty

public static final boolean isNullOrEmpty(Map m)
Determines whether a Map is null or empty?

Parameters:
m - the collection; may be null
Returns:
true if it is; false otherwise

isNullOrZeroLength

public static final boolean isNullOrZeroLength(byte[] bytes)
Determines whether a byte[] is null or has a length of zero?

Parameters:
bytes - the array; may be null
Returns:
true if it is; false otherwise

clear

public static final StringBuffer clear(StringBuffer b)
Clears the contents of a StringBuffer.

Parameters:
b - the b; may be null