gausssoft.lang
Interface LangConstants


public interface LangConstants

Collection of frequently used language-related objects.

Author:
Allan Crooks

Field Summary
static Object NULL
          An object representing the null object.
static Object PURENULL
          An object which behaves like NULL, but differs in the equals method, which only returns true if the object supplied is null.
 

Field Detail

NULL

public static final Object NULL
An object representing the null object.

This object can be used as either a replacement for null or as a flag for null. For example, in an array searching algorithm, where you are supplied with an object to search for (possibly null), you would probably need to write two algorithms, one using the equals method, and one using the == comparator if the object supplied is null. With this object, however, you simply reassign the parameter to this object, and you can then specify just one algorithm.

The other use, as a flag, can be used for situations where null is not allowed to be used, or if the use of null has a special meaning, and you wish to specify null outside the special meaning. You could also use it to store information in an array, and use it to differentiate instances of null which were entered there, and instances of null which were placed there by the virtual machine when the array was created.

The methods overridden from the Object class are:

This object is serializable. If you want to use an object which acts in the same way, but has an equals method which only returns true when the object supplied is null, then use PURENULL.

See Also:
PURENULL

PURENULL

public static final Object PURENULL
An object which behaves like NULL, but differs in the equals method, which only returns true if the object supplied is null. If the object is supplied with itself as an argument for the equals method, it will return false.
See Also:
NULL