Class IPointHash.IntImpl

java.lang.Object
com.github.yellowstonegames.grid.IPointHash.IntImpl
All Implemented Interfaces:
IPointHash
Direct Known Subclasses:
FlawedPointHash.FNVHash, FlawedPointHash.LowLeaningHash, IntPointHash, KnownSizePointHash
Enclosing interface:
IPointHash

public abstract static class IPointHash.IntImpl extends Object implements IPointHash
A convenience abstract class to implement IPointHash when you have an int for state. Subclasses will need to implement IPointHash.hashWithState(int, int, int), IPointHash.hashWithState(int, int, int, int), IPointHash.hashWithState(int, int, int, int, int), and IPointHash.hashWithState(int, int, int, int, int, int, int). They can optionally override setState(int), and can at their discretion provide an accessor for the protected int state.
  • Field Details

    • state

      protected int state
  • Constructor Details

    • IntImpl

      public IntImpl()
    • IntImpl

      public IntImpl(int state)
  • Method Details

    • setState

      public void setState(int state)
      Specified by:
      setState in interface IPointHash
    • hash

      public int hash(int x, int y)
      Specified by:
      hash in interface IPointHash
    • hash

      public int hash(int x, int y, int z)
      Specified by:
      hash in interface IPointHash
    • hash

      public int hash(int x, int y, int z, int w)
      Specified by:
      hash in interface IPointHash
    • hash

      public int hash(int x, int y, int z, int w, int u)
      Specified by:
      hash in interface IPointHash
    • hash

      public int hash(int x, int y, int z, int w, int u, int v)
      Specified by:
      hash in interface IPointHash