Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-830

Add isEmpty() method to Hasher

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 4.5.0-M1
    • None
    • Collection

    Description

      The Hasher interface in the bloomfilter package does not have a way to determine if the hasher is empty.  For the SimpleHasher implementation that is not an issue, however, the HasherCollection can be empty, and there is no guarantee that any other implementation of Hasher may have an empty state.

      I have a use case where a Hasher is passed to a search method in a multidimensional Bloom filter.  If the hasher is empty then we are doing the equivalent of a table scan in a database.

      It is possible to determine if the hasher is not empty by something like

      boolean[] notEmpty = boolean[1];
      hasher.indices( shape ).forEachIndex( i ->{notEmpty[0]=true;return false;});

      And then checking notEmpty[0].

      Attachments

        Issue Links

          Activity

            People

              claude Claude Warren
              claude Claude Warren
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m