Skip to content

agdturner/ccg-generic

Repository files navigation

Description

A modularised Java library only dependent on the openJDK and ccg-io providing:

  • memory - a package for memory management that specifically helps avoid and handle instances of OutOfMemoryError. The handling generally entails copying data from the fast access memory (RAM) to the slow access memory (disk) and then clearing it from RAM - a process sometimes known as "swapping to disk". Application data stored on disk is typically organised using IO_Cache data stores. Managing memory well so that algorithms remain efficient often involves knowing what parts of data are likely to be needed and when. This allows for proacive management rather then reactive management (which has to happen when a memory store is full and more memory on that store is being demanded).
  • Functionality that has been found commonly useful and was not available in what was the latest openJDK at the time.

(See below for Details.)

Latest versioned release

Developed and tested on Java Development Kit, version 15.

<!-- https://mvnrepository.com/artifact/io.github.agdturner/agdt-java-generic -->
<dependency>
    <groupId>io.github.agdturner</groupId>
    <artifactId>agdt-java-generic</artifactId>
    <version>2.0</version>
</dependency>

JAR

Development plans/ideas

  • There are no known issues or feature requests.
  • Develop in an agile way.
  • As the OpenJDK develops the functionality of this library may become redundant.

Development history

Changes from version 1.11 to version 2.0

The part of the library that provided a cache and some generic input and output utility methods was abstracted to ccg-io which became a dependency for this.

Origin

This code began development bundled together with lots of other code developed for an academic research project. Gradually, common code generated from other academic research projects formed into this library which is being rationalised.

Contributions

  • Welcome.

LICENSE

Package details

1. core

A generic environment class for those things that most objects might want to access.

A serializable class that holds a transient reference to a Generic_Environment instance (env).

A class that holds commonly used Strings.

Generic utility class for process execution handling.

3. io

A class for holding Input/Output (IO) defaults.

A class for helping to organise data Files.

  • It is usual that for data processing tasks there is a data directory (dataDir).
  • Input data are to be stored within dataDir in an input directory (inputDir).
  • Generated data are to be stored within dataDir in a generated directory (generatedDir).
  • Output data are to be stored within dataDir in an output directory (outputDir).

General Input/Output utility class mostly now just containing methods for setting the syntax of StreamTokenizers.

4. lang

Utility methods for String transformations.

5. math

Contains methods for adding two Numbers and testing if Numbers can be stored as other types of Number if not exactly, then within a specific error bound.

A class to be extended for memory management involving caching data from the fast access memory to files and then clearing this from the fast access memory. Most methods handle OutOfMemoryErrors should they be encountered, but generally the aim is to avoid these by testing for available memory and caching data prior to running very low on memory.

An interface for memory management which outlines the methods required.

A class with methods that help in testing the availablity and usage of fast access memory.

7. time

Holds a reference to a LocalDate and provides methods to compare and process dates.

Simply holds a LocalDate start and a LocalDate end.

Holds a reference to a LocalDateTime and provides methods to compare and process times.

Holds a reference to a YearMonth and provides methods to compare and process year-months.

8. util

Contains methods for processing and manipulating collections including Lists, Arrays, Sets and Maps.

This pre-dates java.time and was used in programs that ticked through time acting effectively like a stop-watch type clock. It holds methods to help with processing dates and aggregating data by time periods (e.g. hours, months).

A class with methods for visualisation that will work in headless environments.