Java utility library for Java standard libraries

This project provides various utilities (static methods) that work with built-in Java standard libraries.

Some examples are:

  • Generate integer array where each element is sampled between some given range.
  • Generate continuous random numbers of different data types (such as double and float) between a given range.
  • Generate (discrete) random integers (cast to a given type) between some given range.
  • Generate array of different data types sampled from normal distribution.
  • Generate an array of different data floating point types given a minimum value, a maximum value and number of points.
  • Generate an array of increasing numbers given a start value, number of values and a floating point increment value.
  • Convert row major order of Java arrays of different types to column major order, and vice versa.
  • Convert Java 1D array from one data type to another such as int array to float array, and byte array to double array.
  • Convert Java 2D array from one data type to another such as int array to float array, and byte array to double array.
  • Convert Java 3D array from one data type to another such as int array to float array, and byte array to double array.
  • Get a buffered image from a given image file path.
  • Resize a buffered image.
  • Convert buffered image to different types such as int array and byte array.
  • Get number of rows, columns and channels of a BufferedImage object.
  • Convert Java array to BufferedImage object.
  • One Java 1D array to 2D array of given size, 3D array of given size and vice versa.
  • Extract portions or subsets of Java 2D arrays.
  • Find indices in an array that satisfies a condition.
  • Perform operations on Java arrays such as multiplication, addition, subtraction and power, including in-place operations.
  • Apply some functor to every element of template list, template array, etc.
  • Sort numbers in Java array and get both sorted values and sorted indices.
  • Compute statistics on Java arrays such as mean, median and mode.
  • Binary search upper bound on Java array.
  • Binary search lower bound on Java array.
  • Check if an array of different data types is sorted in ascending or descending order.
  • Convert a List of values to array of different data types.
  • Compute the set difference between two given Java arrays.
  • Serialize and save a given object to a file on disk.
  • Load a saved object that has been serialized.
  • Get all files in a given directory of specific extensions.
  • Delete all files inside a given directory.
  • Recursively delete all files/folders inside a given directory.
  • Convert i,j,k 3D position in a matrix to linear index stored in col major format
  • Convert i,j,k 3D position in a matrix to linear index stored in row major format
  • Convert a linear index stored in col major format to i,j,k 3D position in a matrix
  • Convert a linear index stored in row major format to i,j,k 3D position in a matrix
  • Pretty-print 1D java array of different types (i.e. int, float, double and byte).
  • Pretty-print 2D java array of different types (i.e. int, float, double and byte).
  • Pretty-print 3D java array of different types (i.e. int, float, double and byte).
  • Pretty-print 1D java array of template type.
  • Pretty-print 1D java List.
  • Pretty-print 1D array of String objects.

The code is available at: https://github.com/Kyaw-Kyaw-Htike/Java-utility-library-for-Java-standard-libraries

  • Programming languages: Java