Class Hashers

java.lang.Object
squidpony.squidmath.Hashers

public class Hashers
extends Object
Additional implementations of the CrossHash.IHasher interface for more specialized uses, like for use in an OrderedSet or OrderedMap 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 CrossHash.IHasher caseInsensitiveStringHasher
    Hashes and equality-checks CharSequences, such as Strings and StringBuilders, using case-insensitive comparison in a cross-platform way.
    static 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.
    static 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.
    static 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.
    static 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.
    static 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.
  • Constructor Summary

    Constructors 
    Constructor Description
    Hashers()  
  • Method Summary

    Methods inherited from class java.lang.Object

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

    • caseInsensitiveStringHasher

      Hashes and equality-checks CharSequences, such as Strings and StringBuilders, using case-insensitive comparison in a cross-platform way.
    • 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

      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

      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

      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

      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