Introduction

What is DJUTILS?

DJUTILS is a set of Java classes that are used by other TU Delft projects such as DSOL, OpenTrafficSim, Sim0MQ, GSCG, and others.

  • DJUTILS contains immutable collections, such as the ImmutableList, ImmutableSet and ImmutableMap.
  • DJUTILS offers several helper classes for logging using the tinylog package.
  • DJUTILS provides several classes for handling exceptions in an easy way, such as Throw and Try.
  • DJUTILS has a class to easily resolve URLs from a resource location, also when the resource is in a JAR file.
  • DJUTILS extends the reflection classes of Java with several new classes to easily work with Method, Field, and Class signatures.
  • DJUTILS has a package that implements computation of three kinds of mean value.

Origin

DJUTILS was developed at the Delft University of Technology as part of the Open Traffic Simulator project (started in 2014) and the Delft Simulation Object Library (DSOL) project (started in 2002).

The main authors/contributors of the DJUTILS project are Alexander Verbraeck, Peter Knoppers, and Wouter Schakel.

Maven use

Maven is one of the easiest ways to include DJUTILS in a Java project. The Maven files for DJUTILS reside at https://djutils.org/maven. When a POM-file is created for the project, the following snippet needs to be included to include DJUTILS:

<dependencies>
  <dependency>
    <groupId>org.djutils</groupId>
    <artifactId>djutils</artifactId>
    <version>1.02.00</version>
  </dependency>
</dependencies>

Of course, the version number (1.02.00 in the above example) needs to be replaced with the version that one wants to include in the project.

Right now, the DJUTILS files are kept on a server at TU Delft, and are not yet made available on Maven Central. Therefore, the repository location has to be specified separately in the Maven POM-file:

<repositories>
  <repository>
    <name>djutils Public Repository</name>
    <id>djutils</id>
    <url>https://djutils.org/maven</url>
  </repository>
</repositories>

Dependencies

DJUTILS is directly dependent on one package, which can have further dependencies:

  • tinylog for providing an easy-to-use and fast logger.

If the DJUTILS library is used as a part of a Maven project, all dependencies will be automatically resolved, and the programmer / user does not have to worry about finding the libraries. Documentations and test reports DJUTILS documentation and test reports for the current version can be found at https://djutils.org/docs/current and the API can be found at https://djutils.org/docs/current/apidocs/index.html.