The djutils-data project contains classes for sampling, storing and retrieving statistics data.
For now, the main data type is a data table with column heading information and records.
Separate packages to read/write the tables from the djutils-data project have been added for:
JSON, XML, and csv/tsv. Specific (de)serializers have been added for primitive types, Number types,
String, DoubleScalar types and FloatScalar types.
static 'of' methods have been added to the Immutable collections, to have an easy instantiation method
for the collections. Example: ImmutableMap<Integer, String> map = ImmutableMap.of(1, "value1", 2, "value2");
These static methods have been added to: ImmutableList, ImmutableSet, ImmutableSortedSet, ImmutableMap,
and ImmutableSortedMap. The maps can take up to 8 key-value parameters, whereas the sets and lists
can take an unlimited number.
The Tally now has methods to request the skewness and kurtosis of the provided data.
The djutils-stats project contains data summarizers such as the Counter, the Tally, and the WeighedTally.
The original classes Counter, Tally and Persistent from dsol-core have been generalized and improved.
A class called DistNormalTable has been added to calculate the cumulative values of the cumulative
normal distribution. This replaces an older and less precise table from dsol-core. A project called
djutils-generator has been added that contains a class to generate this table.
For the new classes in djutils-stats, EventBased versions have been created that can receive the data
via a notify() method.
Because of the increasing number of sub-projects in djutils, a parent pom project has been added called
djutils-pom. This project contains all version numbers, dependencies and definitions for the derived
djutils projects.
Added the MultiKeyMap to djutils (comes from ots.core.gtu.NestedCache in a less generic form).
MultiKeyMap implements a map with multiple keys.
In order to prevent name clashes for the EventType, the full name of the class from which the EventType
was defined (usually in the clinit method) is added to the equals() and hashCode() methods of the EventType.
In that way, EventTypes that are the same will be unique, but EventTypes with just the same name but defined
in different classes will be different. The reason why this is important is because remote events that use
EventTypes can have multiple versions of the same public static final EventType: one the is defined
in the client, and one that is defined via the network. These will have different addresses in memory
but they share the same class and name info, so equals() will yield true.
Added a protected method to the EventProducer to return a safe copy of the list of (strong or weak)
references to the registered listeners for a provided event type, rather than exposing the
internal 'listener' object.
The EventProducer classes uses a helper class EventProducerImpl to do the real work, to avoid code duplication.
The RemoteEventProducer class lacked implementation of the fireEvent and fireTimedEvent protected methods.
These have been added and linked to the EventProducerImpl class to do the work.
Added the Profile class to DJUTILS (moved it out of the ots-core project). Contains profiler code for methods or
parts of methods.
More extensive tests of the Try class and the URLResource class added.
CliUtil in djutils-ext had problems with changing the default option values for subclasses, where the
options were defined in a superclass. The key under which the overrides are stored in CliUtil have been
changed to the actual class where the option was defined, both in storing and in retrieving the
override. Tests in the TestCLI unit tests check the new behavior.
Added the three new DJUNITS units AngularAcceleration, AngularVelocity and Momentum to djutils-serialization.
The subSet, headSet and tailSet methods of ImmutableTreeSet would use the default comparator of the data type instead of
inheriting the comparator of the underlying set. This bug was discovered while writing thorough unit tests.
The documentation of (non-immutable) TreeSet is not clear about whether the subSet and friends should inherit the
comparator, but the implementations in the java Collections framework do inherit the comparator.
In contrast with earlier implementations of the Event package, a sourceId is sent over the network
rather than a pointer to the source itself. This has several advantages:
The object extending the EventProducer does not have to be Serializable itself
There is no risk that the entire EventProducer object gets serialized (including subclasses)
and is sent over the network
The receiver of an event does not get a pointer to the sending object
The receiver of an event is still able to identify the sending object
]]>
New version of generated code in TestCLIUnitConverters.java.
New units in CliUnitConverters.
The classes RMIUtils and RMIObject have been added to make it easier to work with remote objects.
RemoteEventProducer and RemoteEventListener extend RMIObject to select the host and port of the
RMI registry. Therewith the remote event handling has become a lot more flexible.
EventProducer is not an abstract class anymore, as it does not contain any unimplemented methods and
because it is used as an embedded class in the RemoteEventProducer.
Demanded that the fields of the Event and TimedEvent are serializable, so they can be sent over
the network or stored on disk by serialization.
Removed various redundant synchronized blocks from EventProducer.java (method was already synchronized).
More complete nullPointer checks in EventProducer.java; Javadoc cleanup in EventProducer.java
Removed the ConditionalLogger from the CategoryLogger and transfered the when(...) functions to
both the static Logger and the DelegateLogger class.
DelegateLogger did not consider the LogLevel correctly in deciding whether a message needed to be logged.
This has been repaired. Every logging method now first checks whether the indicated log level is
included in the log levels that need to be shown.
CategoryLogger now has methods for adding and removing Writers, and listing which writers are available.
Expanded unit tests for CategoryLogger and EventProducer.
The explicit setting of log level and message formatter on individual writers in the CategoryLogger now works
as intended. The setAllLogMessageFormat and setAllLogLevel methods in the CategoryWriter reset the values
for each individual Writer, as well as the global standard for next writers to be registered.
ClassUtil had a method called changeAnnotationValue to change the value of an annotation field value. This
method made changes to an internal data structure that is not intended to be altered. From Java-13 onwards
a warning appears in the console for manipulating this data structure. Therefore the method has been removed.
The CliUtil class in djutils-ext used the changeAnnotationValue method from ClassUtil. Instead of changing
the internal data structure of the annotations, an override map is now used to store the changes. This also
ensures that the code structure is reentrant: no structural changes have been made to the appearance of the
loaded code (which the changeAnnotationValue method did in a sense).
Methods to read the (overridden or original) program version, program name and program description
in @Command have been added to CliUtil.
The EventProducer had a non-transient semaphore object, rendering it non-serializable. The
lock has been replaced by a lock on the listeners object instead. The lock has been applied
more consistently in the code to avoid ConcurrentModificationExceptions.
All Dumper classes in DecoderDumper now use UTF-8 to dump the data, to ensure reproducibility of the
code across platforms.
The event package for pub/sub, originally the dsol-event package, has been added to DJUTILS and
will be removed from the next version of DSOL.
Many open issues in the DSOL event package has been fixed in the port to DJUTILS. Examples are adding
equals and hashCode methods for the TimedEvent, better writeObject and readObject methods for the
EventListenerMap, repair of the failure to sometimes remove an EventListener from the EventProducer, etc.
Almost full unit test coverage has been added to the djunits event package.
The event producing collections in the event.util package now only fire events when additions or
removals actually took place, not just when the add / remove / put methods are called.
The EventProducingCollection, EventProducingList, EventProducingMap and EventProducingSet in the
event.util package also fire events when content in the collections has changed. In that case,
a CHANGE_EVENT is fired.
The events of the event producing collections in the event.util package now have events that carry a
payload. The payload is the new number of entries in the collection for the ADD_EVENT and REMOVE_EVENT.
The event's content is equal to null for the CHANGE_EVENT.
Since the boolean for strong versus weak references in the EventProducer was always unclear (does
true mean strong or weak?), it has been replaced by an enum.
Several of the underlying data structures of the djutils package have been changed from a HashMap
to a LinkedHashMap and from a HashSet to a LinkedHashSet to guarantee reproducibility of results.
As an exception the ImmutableHashSet and ImmutableHashMap are still backed by unlinked variants,
as they explicitly are not reproducible.
DJUNITS updated to 4.01.03.
Extensive unit test coverage has been added for the ClassUtil class. Several errors have been repaired,
and the signature of a number of methods has changed slightly (getAllMethods returns a List rather than
an array, for example).
Ensured that "package-list" exists in apidocs for backward compatibility of javadoc linking.
Replaced FindBugs (which already had a problem supporting Java 8) with SpotBugs
(supporting later Java versions as well).
DJUNITS updated to 4.01.01.
Included jakarta.annotation-api to be compatible with Java 11+.
tt-tag in javadoc replaced by code-tag to be compatible with HTML-5 and Java-11+.
javadoc source version 8 added to pom-file to be compatible with Java-11+.
DJUNITS updated to 4.01.00.
CliUnitConverters in djutils-ext have been regenerated. A @Generated tag has been added to each generated method.
Little-Endian types have been removed as FieldTypes in djutils-serialization. Instead, messages that
need to be decoded can indicate whether they want to (de)code as Little-Endian or Big-Endian.
By default, following Java standards, djutils-serialization encodes in Big Endian (network byte order).
DJUNITS has been updated to version 4.00.04, bringing major changes to the way vectors and matrices
are stored and processed.
As a result of moving to DJUNITS-4, the Money units with their special encoding have been removed
temporarily. This also holds for the MoneyPerUnit types.
As a result of moving to DJUNITS-4, several new types have been added to the possible units to use:
AbsorbedDose, AmountOfSubstance, CatalyticActivity, ElectricalCapacitance, ElectricalConductance,
ElectricalInductance, EquivalentDose, Illuminance, LuminousFlux, LuminousIntensity,
MagneticFluxDensity, MagneticFlux, and RadioActivity.
The package structure for djutils-serialization has been updated. Complex (de)serializers
have been coded in their own classes rather than in an inline class.
CliUtil in djutils-ext now has a method call with a CommandLine object. This enables e.g., the
registration of custom parameter converters. An example and test is provided in
TestCLIRegisterConverters.java in the test package.
Added unit tests for djunits converters for the CLI package. Dimensionless can also parse just a number.
Unit tests with System.exit() were failing in Maven surefire. Surefire documents that System.exit()
calls cannot be tested. Therefore a Security Manager has been implemented in the test class ExitHelper
for these tests that catches the System.Exit and turns it into an ExitException.
Repaired the code for the ClassFileDescriptor for paths with spaces.
Added a unit test to see if folders with spaces can be found for the ClassFileDescriptor.
Repaired a bug for folders with spaces for the ClassFileDescriptor.
Added unit tests for ClassUtil.
Repaired a number of bugs and changed some code in ClassUtil. It does not make sense to resolve
constructors of superclasses, as only constructors of a class to be instantiated can be called.
Therefore all code that deals with constructors in superclasses has been removed.
The methods in ClassUtil that deal with visibility from a callerClass now throw an
IllegalAccessException when the method/field/constructor is not visible from the callerClass
and a NoSuchMethodException or NoSuchFieldException when the method/constructor/field
cannot be found.
ClassUtil has resolveAnnotation methods.
CliUtil also resolved @Command and @Option annotations in a superclass.
ClassUtil got extra methods to retrieve information about a class file, e.g. the last changed date.
CliIUtil has been renamed to the correct CliUtil.
Several helper methods have been added to CliUtil to change some of the @Options and
@Command settings.
A project for more utility classes that require more dependencies called djutils-ext has been added.
Classes for Command Line Interface parsing have been added. The classes are based on picocli.
A utility class with converters for DJUTILS command line arguments has been added. With these
converters, it is possible to e.g. specify --timeout=30s on the command line and convert the
timeout to a DJUNITS Duration scalar.
The byte[][] serialization destroyed the underlying data -- this has been repaired.
The serializers have all been made strongly typed, avoiding casting. Or actually, the casting has been
shifted to the encode method on a higher level.
The ImmutableLinkedHashMap.values() was overriding a non-reproducible values() method from the
ImmutableAbstractMap. The ImmutableLinkedHashMap now has its own values() method.
The ImmutableLinkedHashMap returned a non-linked HashSet as EntrySet and as KeySet. This has
been repaired.
The UTF-8 Strings in djutils-serialization have been improved. The UTF-8 String can now handle
1-byte, 2-byte, 3-byte and 4-byte characters. The length of the UTF-8 serialized bytes indicates
the number of bytes. The length does not say anything about the number of characters.
The UTF-16 Strings in djutils-serialization have been improved. The UTF-16 String can now handle
2-byte and 4-byte characters. The length of the UTF-16 String indicates the number of 2-byte
shorts in the array. The length does not say anything about the number of characters.
The byte array in djutils-serialization has been repaired. The underlying byte array was nulled
during serialization.
ObjectArraySerializer and ObjectMatrixSerializer added.
SerialDataDumper added to provide insight into structure of the serialized data.
The djunits-serialization project has been added to serialize and deserialize different classes
including djunits scalars, vectors and matrices in a strongly typed manner.
EntrySets have been added to the ImmutableMap classes.
The keySet(), values() and entrySet() methods cache the results as these are often called.
The ImmutableCollections class has been added, which takes care of those functions of the
Collections class that do not update the (immutable) collections that the methods receive
as arguments.
Cat class in the logger package belongs in dsol, not in djutils, so removed it.
The 'decoderdumper' package has been added to the djutils project, extending
and replacing HexDump.
The CategoryLogger has been extended with a 'when(condition)' static method.
A call like CategoryLogger.when(ok).always().info("Ok"); is now possible.
The HexDump class has been added to djutils to create hexadecimal dumps of data.
Copyright message changed to 2019.
The 'means' package has been added to the djutils project.
Several classes from other projects that are heavily shared between the projects, but not
specific for one of the projects have been transferred to the djutils project.