The Mozilla
Organization
At A Glance
Feedback
Get Involved
Newsgroups
License Terms
Newsbot
Developer Docs
Roadmap
Projects
Ports
Module Owners
Hacking
Get the Source
Build It
Testing
Download
Bugzilla
Bug Writing
Tools
View Source
Tree Status
New Checkins
Submit A Bug
FAQ
Search

Utility classes for Java Code

This project is a collection of utility classes for Java programmers. These classes supplement the classes found in java.util and in the JDK collections classes. This document presents the highlights of the util classes and also provides information on checking out the code.

The complete API documentation can be found at http://www.mozilla.org/projects/blackwood/java-util/api/.

Highlights

    Assert

      One thing sorely lacking in Java is an assertion facility. This class provides a robust, complete, assertion facility. The best way to use the Assert class is:

      if (Assert.enabled && Assert.assert(mytest(), "my test failed"));

      Such usage prevents not only mytest() from being executed if assertions are disabled but also the assert method itself, and some compilers can remove the entire statement if assertions are disabled.

    ParameterCheck

      ParameterCheck provides convenient means for parameter checking. Class methods in the ParameterCheck class can be used to verify that method parameters meet certain conditions and to raise exceptions if the conditions are not met.

      Typical usage:

      ParameterCheck.nonNull(myParameter);

      This verifies that myParameter is not null, throwing an IllegalArgumentException if it is.


Ed Burns
Last modified: Wed Jul 28 17:52:30 PDT 1999
Copyright © 1998-2000 The Mozilla Organization.
Last modified July 30, 1999.