Class PrimitiveDataChecksum

java.lang.Object
org.greenrobot.essentials.hash.PrimitiveDataChecksum
All Implemented Interfaces:
Checksum

public class PrimitiveDataChecksum extends Object implements Checksum
Wrapper for Checksum that accepts all kind of primitive data to update the hash.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Checksum
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    void
     
    void
    update(byte[] numbers)
    Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    void
    update(byte[] b, int off, int len)
     
    void
    update(double[] numbers)
    Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    void
    update(float[] numbers)
    Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    void
    update(int b)
     
    void
    update(int[] numbers)
    Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    void
    update(long[] numbers)
    Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    void
    update(short[] numbers)
    Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    void
    updateBoolean(boolean value)
    updates a byte with 0 for false and 1 for true
    void
    updateDouble(double number)
     
    void
    updateFloat(float number)
     
    void
    updateInt(int number)
     
    void
    updateLong(long number)
     
    void
    updateShort(short number)
     
    void
    Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    void
    updateUtf8(String[] strings)
    Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.zip.Checksum

    update
  • Field Details

    • checksum

      private final Checksum checksum
  • Constructor Details

    • PrimitiveDataChecksum

      public PrimitiveDataChecksum(Checksum checksum)
  • Method Details

    • update

      public void update(int b)
      Specified by:
      update in interface Checksum
    • update

      public void update(byte[] b, int off, int len)
      Specified by:
      update in interface Checksum
    • getValue

      public long getValue()
      Specified by:
      getValue in interface Checksum
    • reset

      public void reset()
      Specified by:
      reset in interface Checksum
    • updateUtf8

      public void updateUtf8(String string)
      Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    • updateUtf8

      public void updateUtf8(String[] strings)
      Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    • updateBoolean

      public void updateBoolean(boolean value)
      updates a byte with 0 for false and 1 for true
    • updateShort

      public void updateShort(short number)
    • updateInt

      public void updateInt(int number)
    • updateLong

      public void updateLong(long number)
    • updateFloat

      public void updateFloat(float number)
    • updateDouble

      public void updateDouble(double number)
    • update

      public void update(byte[] numbers)
      Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
      Specified by:
      update in interface Checksum
    • update

      public void update(short[] numbers)
      Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    • update

      public void update(int[] numbers)
      Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    • update

      public void update(long[] numbers)
      Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    • update

      public void update(float[] numbers)
      Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
    • update

      public void update(double[] numbers)
      Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).