Skip to content

Releases: tommyettinger/jdkgdxds

0.2.2 "Order From Chaos"

30 Oct 02:42
Compare
Choose a tag to compare

This release fixes one bug in the just-added Base class, but it was a bug that made Base significantly less useful, so here's a small fix release. Specifically, when a base was requested to be case-insensitive, it would effectively be ignored in the last release, and will be correctly case-insensitive in this release. The notes from the previous release, 0.2.1, still apply:

This release mostly improves the random number generators; it adds StrangerRandom and Xoshiro256StarStarRandom, and fixes the nextInt(int, int) and nextSignedInt(int, int) methods (only the two-argument ones were broken, and only for some arguments). It adds a nice natural-text sort in NaturalTextComparator, using mostly this code as a basis. It also adds the Base class for numeral/base systems, which generalizes code that deals with decimal, binary, hexadecimal, base-64, and all sorts of other radices. I hope this is useful!

0.2.1 "Primordial Chaos"

29 Oct 06:34
Compare
Choose a tag to compare

This release mostly improves the random number generators; it adds StrangerRandom and Xoshiro256StarStarRandom, and fixes the nextInt(int, int) and nextSignedInt(int, int) methods (only the two-argument ones were broken, and only for some arguments). It adds a nice natural-text sort in NaturalTextComparator, using mostly this code as a basis. It also adds the Base class for numeral/base systems, which generalizes code that deals with decimal, binary, hexadecimal, base-64, and all sorts of other radices. I hope this is useful!

0.2.0 "Created Equal"

05 Aug 06:36
Compare
Choose a tag to compare

This release is a bit more of a breaking change than usual, but only for some usage. In earlier releases, you would override locateKey() if you wanted to change the behavior for equality comparison, and this needed a bunch of copy/paste of existing code from the docs. Now, there's a more elegant approach in the equate() method, which is used wherever Object keys need to be compared, and is present in all the object-keyed maps and sets. This makes it so place() and equate() are all you need to alter in subclasses that need different comparison of keys. You can still use code that overrides locateKey(), but it won't affect any other places that compare keys to each other, and changing to use equate() is encouraged and should result in smaller code. This also includes some optimizations being worked on by the Kryo project, which remain relevant here, and help performance in many cases.

0.1.3 "Deque Building"

15 Jun 06:05
Compare
Choose a tag to compare

This release mostly adds deque (double-ended queue, or stack/queue hybrid) classes for generic Objects and all primitive types (except boolean, which you can really just use a byte for). I'm not sure what people will use these for, but they offer more functionality than ArrayDeque in the JDK by allowing random-access get() and set() into the deque.

This also makes a potentially breaking change by renaming the inner (and barely-exposed) classes implementing Iterator so they don't all have the same name. It was just a little confusing to have multiple SetIterators in differerent classes, all exposed somewhat. Since the iterator() method on all of these sets returned an Iterator or some type of PrimitiveIterator, and not the renamed class, there should usually be no change required.

0.1.2 "Serving With Distinction"

13 May 10:31
Compare
Choose a tag to compare

This release is mostly bugfixes, and most of those apply to the ordered maps, but there's also some new code in the form of DistinctRandom.
If you used SquidLib (anyone?), it's very similar to its LightRNG class, and if you used desktop Java 8, it's somewhat similar to the SplittableRandom class, just without the splitting. It has one state that can have any long for its value, and it will return every possible long with its nextLong() method before it repeats a returned value. The ordered map fixes mostly apply to less-commonly-implemented methods like getAndIncrement() on maps with numeric values; these weren't updating the order before.

0.1.1 "Fine Pig"

29 Apr 03:45
Compare
Choose a tag to compare

This release mostly fixes Google Web Toolkit incompatibilities that had snuck into several places in the library. It's kind of hard to test GWT compatibility unless you're really looking for it, so I missed this for a while. I also added a lot more features to EnhancedRandom, like inclusive and exclusive double/float generation (which were more complicated than they sound), and a new implementation of EnhancedRandom, TricycleRandom. TricycleRandom is sometimes much faster than LaserRandom, but doesn't do much to randomize its initial state when it generates its first output (which can result in non-random seeming output for very small sample sizes). If you use its setSeed(long) method or its one-long constructor, that sidesteps this issue.

A breaking change here is that code that previously took a java.util.Random now takes an EnhancedRandom; there's basically no reason to encourage using the bad java.util.Random code. LaserRandom and TricycleRandom do extend Random for compatibility, but using Random isn't a requirement otherwise.

0.1.0 "Making a List"

03 Apr 05:17
Compare
Choose a tag to compare

This release is another fairly large one; it adds all the necessary interfaces (including more primitive FunctionalInterface types) to complete the primitive-backed lists. This means we have a ByteList, ShortList, CharList, DoubleList, and BooleanList now, all implementing some form of Ordered and with largely the same functionality as the existing IntList, LongList, and FloatList. The previous release had IntToIntFunction, which apparently exists in the JDK as IntBinaryOperator for some reason (hooray for inconsistent naming schemes; now it isn't just libGDX doing it!). That and LongToLongFunction are now replaced with the corresponding JDK BinaryOperator. EnhancedRandom now allows implementations to specify how many states can be get and set with getSelectedState() and setSelectedState(). A bug was fixed at about the same it was discovered in libGDX, affecting IntObjectMap (and IntObjectOrderedMap here), a rare one that could happen during repeated removal and re-insertion of the key 0 via an iterator. Lastly, all usage of java.io.Serializable is gone; it's too much of a problem to support in new code, and there are better alternatives. The new primitive lists should make their way into jdkgdxds_interop soon.

0.0.6 "Massive Functionality"

21 Mar 04:49
Compare
Choose a tag to compare

This is a big release, bringing a lot of Java 8 default methods into the primitive-backed maps (and to a lesser extent, the lists and sets). If you wanted to call putIfAbsent(), replace(), merge(), or any number of other methods on a LongFloatOrderedMap (where typically you'd have to use an ObjectObjectOrderedMap to get access to them), well, now you can. This required defining a whole lot of functional interfaces, including some that were surprisingly omitted from the JDK, like one that takes an int and returns an int (IntToIntFunction). There's also code matching libGDX's uncommon support for the QuickSelect algorithm, which can be used with any Ordered data structure or primitive-backed subtype of Ordered. Just, in general, this was a big one.

0.0.5 "Five Is Live"

08 Feb 04:06
Compare
Choose a tag to compare

This release adds a few useful classes, like the case-insensitive Sets, and makes several others more useful. There are major fixes for case-insensitive Maps. BinaryHeap now implements the JDK Queue interface, acting like a real priority queue. Many of the primitive-backed collections can be constructed with PrimitiveCollection objects, like FloatList or ObjectFloatMap.Values. There are more with() methods to easily construct sets. All of the internal key sets, value collections, entry sets, and so on are marked transient, allowing automatic serialization to write classes that have such internal collections. In general, this should be a solid release.

0.0.4 "It Takes Two"

03 Jan 05:20
Compare
Choose a tag to compare

This release mostly adds useful addAll() methods to all maps here, as well as constructors that call those addAll() methods at the start. These all take keys and values as side-by-side arrays or Collections (these can be PrimitiveCollection types, like LongList, for primitive-backed keys or values), and insert paired keys and values until either the keys or values are exhausted. This matches one of the useful features of fastutil, and should make it easier to implement "Maker" methods like SquidLib has. There's now an IdentityObjectMap (and its Ordered counterpart), using == comparison and System.identityHashCode(). ObjectList now reuses its iterator by default, matching libGDX's Array, and the primitive-backed collections like IntList, much more closely. BitConversion has a super-sourced lowestOneBit() that behaves correctly on GWT for long inputs (Long.lowestOneBit() does not give accurate results for many inputs on GWT, but fixing that is easy here). It's not a huge release, but it should come in handy.