The Mozilla
Organization
Our Mission
Who We Are
Getting Involved
Community
Editorials
What's New
Newsbot
Development
Roadmap
Module Owners
Blue Sky
Projects
Status
Tools
Products
Source Code
Binaries
Documentation
License Terms
Bug Reports
Quality
Search
Feedback

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-1999 The Mozilla Organization.