Skip to content

1.4.6 "Yes Filter"

Compare
Choose a tag to compare
@tommyettinger tommyettinger released this 09 Dec 08:09
· 213 commits to master since this release

This release mostly exists so the FilteredString Sets and Maps can be serialized. But wait, I haven't done a release with those classes yet! To recap, here's the changelog (in reverse order...):

[1.4.6]

  • [BREAKING CHANGE] The Filtered-String sets and maps now use a CharFilter object to group their filter and editor, allowing them to be serialized and deserialized.

[1.4.5]

  • The dependency on digital was updated... again... to 0.4.5, though this time it brings several new features. None used here.
  • Filtered-String sets and maps! These are like the CaseInsensitive ones, but allow configuring how characters are used and modified.
  • Filtered-Iterable sets and maps, too! These are like the Filtered-String ones but work on an Iterable of sub-items instead of a String of characters.
  • FilteredComparators provides ways to sort the ordered filtered types.
  • NumberedSet.addOrIndex() was broken, and now is fixed.
  • Nullity annotations were put in the right places pretty much everywhere.
  • I think this is the point Gradle was updated to 8.5; nothing broke, and it shouldn't affect user projects.

[1.4.4]

  • The dependency on digital was updated again to 0.4.3 because of a break in GWT compilation in digital 0.4.2; it is fine now.

[1.4.3]

  • The dependency on digital was updated to 0.4.2, which includes BitConversion.countTrailingZeros(); we use it in OffsetBitSet.
  • A bug in getAndIncrement() for ordered maps with int and long keys was fixed; before, it didn't handle zero keys correctly.
  • The Utilities.longHashCodeIgnoreCase() methods now are much closer to how Hasher implements them in digital; the results are different.

[1.4.2]

  • The dependency on digital was updated to 0.4.1, which includes a new BitConversion.countLeadingZeros() method that we use here to speed things up on GWT a bit.
  • The dependency on checker-qual was updated to 3.39.0, which shouldn't break or really even change anything here.

[1.4.1]

  • [POSSIBLE BREAKING CHANGE] The dependency on digital was increased to 0.4.0, and that version changes what Hasher.hash() and Hasher.hash64() return for the same arguments. This doesn't affect jdkgdxds code, but may affect users who rely on digital transitively.
  • New ObjectList.sortJdk() method will use the default List.sort() method rather than the in-place mergesort used by ObjectList.sort().
  • Updated to Gradle 8.3 and Checker Framework 3.37.0 .

So, there's a lot that has changed since the last release here on GitHub, but new releases have been published to Maven Central all this time. Mostly new are the four FilteredString types and the four FilteredIterable types. I have no hope of serializing FilteredIterable (Ordered) (Set/Map), so those will just be treated as unserializable (at least, to JSON) due to their use of functional interfaces. However, FilteredString (Ordered) (Set/Map) classes can be serialized using jdkgdxds-interop or (soon) kryo-more. This takes advantage of how, starting in 1.4.6, you can register CharFilter types by name, and ser/deser uses that name to get the right CharFilter. But what even is a CharFilter?

A CharFilter is used by each of the FilteredString classes to use a filter to potentially ignore some characters in a String item/key, and an editor to potentially change the characters that aren't ignored (but not destructively editing). A common use for the editor is to convert every character to upper-case if possible (typically using Character::toUpperCase), which makes the FilteredString class act like one of the existing CaseInsensitive ones. You can go further and use the filter to only consider letter characters by using Character::isLetter as the filter, or only alphanumeric chars with Character::isLetterOrDigit.

There's similar behavior in the FilteredIterable types, but instead of a FilteredString type works on a String made of chars, a FilteredIterable works on an Iterable of a generic sub-item type. You still have a filter that can exclude sub-items and an editor that can make a different sub-item get used. I don't expect FilteredIterable types to be used as much as the String ones.

Well, there's that release!