Selection of java utility methods used in almost all projects.
<dependencies>
<dependency>
<groupId>dev.brachtendorf</groupId>
<artifactId>UtilityCode</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
//Restart JVM
MiscUtil.restartApp();
//Enum hashcode
int enumHashcode = MiscUtil.consistentHashCode(Weekday.Monday);
//Array methods
int[] values = {1,2,1,4,5,7,3,4,3,2};
ArrayUtil.median(values);
ArrayUtil.average(values);
ArrayUtil.add(values,5);
...
Package | Description |
---|---|
MiscUtil | Get OS info/ Restart Java VM |
Require | Input assertions similar to Objects.requireNonNull() |
NetworkUtil | Resolve Network adapter and socket helper |
Mutable | Mutable Wrapper for boxed primitives |
StringUtil | Center text, get length of numeric string representation. Multiy strings |
Graphics | Color Utilities, Distance, Average Color, Palettes, Efficient RGB HSC YCrCB (*10 faster than JDK) |
ArrayUtil | Fill, search, compute sorted indices validation, deep clone, scalar operation on arrays |
CryptoUtil | AES en- and decryption |
MathUtil | clamping, fractional part, double compare, log to base x, trangular number |
clustering | small selection of cluster algorithms. KMeans KMeans++ DBScan, see cluster branch for more. WIP |
... | Non daemon thread factory, circular hashmap, rescaling images, ... |
- Support a wider range of image objects for ImageUtil methods
- InterpolateColor for BufferedImage
- dominantColor for BufferedImage
- meanColor for BufferedImage
- getRGB doesn't use inlined code anymore
- getRGB now correctly returns opacity replaced colors
- rename packages from com.github.kilianB to dev.brachtendorf
- FastPixel now support replacement of opaque pixels
- Updated javafx dependency version to point to stable v11 release
- update build dependencies and pom in preparation for maven central deployment
- build target java 11
- small coding style fixed to please codacay
- retrieval of public facing ip address
- support for 1d blue red and green retrieval
- Require exact value
- Pair data structure
- codacy badge
- removed unused imports. A tiny bit cleanup
- bump javadoc version to html 5
- use ImageTypeSpecifier to create a compatible buffered image during resizing operation in image utils. This allows support for buffered image with type custom.
- increased named thread factory test case exception timeout to make test more robust
- Require oddValue,evenValue, greaterThan, lessThan, negativeValue
- default fallback for fastpixel if no faster implementation is available
- CountHashCollection now also returns the mapped object in the toString method
- move some of fastpixels implementation methods to default methods
- perform mcn:clean before deploying to exclude test dependencies from final build.
- getSetAverageGrayScale
- utility toString methods for arrays
- getLuma 1D version
- getLowerShiftBitMask to MathUtil
- getConsistentHashcode for Enums in the misc package
- getLuma now correctly accesses red green and blue values based on BGR byte array offsets instead of RGB.
- refactored FastPixel to use base class and support multiple different image types
- bulk set operation for FastPixel class
- setRed,setBlue,setGreen on FastPixel now access the correct offset
- pairwise array math (add subtract multiply divide)
- fillArray overloaded now available with function parameter passing the index to a supplier method
- getSortedIndex. Calculate the sorted indices of an array in ascending or descending order.
- make constructor of circular hashset private. Class was not ever meant to be initialized
- getScaledInstance of images not correctly uses drawImage to rescale rather than falling back to the awt getScaledInstance call. 600 fold increase in performance
- triangular number
- javadoc get hue is in range of [0-360]° not [0-255]
- getContrastColor for awt images
- getLuma for awt and fxImages
- log(base,value) calculate log of an arbitrary base
- plain autocloseable (AutoCloseable without throwing an exception)
- get maximum and minimum as well as maximum and minimum Index for primitive numeric arrays
- scalar multiplication, addition, subtraction and division for primitive numeric arrays.
- Clustering. KMeans, KMeans++, DBScan, CURE, DistanceMeasures, Euclidiean Jaccard Manhattan
- StringUtils fillStringBeginning
- getLuma() array method
- FastPixel utility to read rgb/hsv/YCrCb data from an image + tests
- MathUtil.isNumeric() + tests
- added @Nested tag to isDoubleEquals class in MathUtil test
-
fillArrayMulti in ArrayUtils allows multi dimensional arrays to be recursively filled with a value
-
test for ArrayUtil
-
Mutable wrappers now extend Number if applicable
-
Mutable now implement increment, decrement setValue for primitive values.
-
test for mutable
- CountHashCollection + test A hash collection with O(1) specialized on keeping track how many times equal object were added and removed
- Circular Hashset
- Circular Queue
- Require.inRange for collections
- replace DaemonThreadFactory by NamedThreadFactory since no external repo is currently depending on this source only bump minor version