Class Hashers

java.lang.Object
com.github.yellowstonegames.old.v300.Hashers

public class Hashers extends Object
Additional implementations of the CrossHash.IHasher interface for more specialized uses, like for use in a hashed Set or Map with String keys that should use case-insensitive equality/hashing. Created by Tommy Ettinger on 4/15/2017.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final CrossHash.IHasher
    Hashes and equality-checks CharSequences, such as Strings and StringBuilders, using case-insensitive comparison in a cross-platform way.
    static final CrossHash.IHasher
    Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but only considers valid chars that are valid components of Java identifiers (it does not check that the Strings are valid identifiers, but considers only letters, digits, currency symbols, underscores (and related underscore-like characters), and a few other types of glyph, ignoring whitespace and most punctuation marks), and works in a cross-platform way.
    static final CrossHash.IHasher
    Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but only considers letters (that is, characters that are in the Unicode category "L", including A-Z, a-z, most characters used in most non-English languages (katakana glyphs from Japanese count as letters, for instance)), and works in a cross-platform way.
    static final CrossHash.IHasher
    Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but does not consider letters (that is, characters that are in the Unicode category "L", including A-Z, a-z, most characters used in most non-English languages (katakana glyphs from Japanese count as letters, for instance)), and works in a cross-platform way.
    static final CrossHash.IHasher
    Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but does not consider any number glyphs (Unicode category "N", including 0-9, but also various numbers in other languages, such as the dedicated Roman numeral characters), and works in a cross-platform way.
    static final CrossHash.IHasher
    Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but does not consider whitespace (including space, newline, carriage return, tab, and so on), and works in a cross-platform way.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • caseInsensitiveStringHasher

      public static final CrossHash.IHasher caseInsensitiveStringHasher
      Hashes and equality-checks CharSequences, such as Strings and StringBuilders, using case-insensitive comparison in a cross-platform way.
    • letterOnlyStringHasher

      public static final CrossHash.IHasher letterOnlyStringHasher
      Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but only considers letters (that is, characters that are in the Unicode category "L", including A-Z, a-z, most characters used in most non-English languages (katakana glyphs from Japanese count as letters, for instance)), and works in a cross-platform way.
    • identifierOnlyStringHasher

      public static final CrossHash.IHasher identifierOnlyStringHasher
      Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but only considers valid chars that are valid components of Java identifiers (it does not check that the Strings are valid identifiers, but considers only letters, digits, currency symbols, underscores (and related underscore-like characters), and a few other types of glyph, ignoring whitespace and most punctuation marks), and works in a cross-platform way.
    • noSpaceStringHasher

      public static final CrossHash.IHasher noSpaceStringHasher
      Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but does not consider whitespace (including space, newline, carriage return, tab, and so on), and works in a cross-platform way.
    • noNumberStringHasher

      public static final CrossHash.IHasher noNumberStringHasher
      Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but does not consider any number glyphs (Unicode category "N", including 0-9, but also various numbers in other languages, such as the dedicated Roman numeral characters), and works in a cross-platform way.
    • noLetterStringHasher

      public static final CrossHash.IHasher noLetterStringHasher
      Hashes and equality-checks CharSequences, such as Strings and StringBuilders, but does not consider letters (that is, characters that are in the Unicode category "L", including A-Z, a-z, most characters used in most non-English languages (katakana glyphs from Japanese count as letters, for instance)), and works in a cross-platform way.
  • Constructor Details

    • Hashers

      public Hashers()