Class LinearIndex

  • All Implemented Interfaces:

    public class LinearIndex
    extends java.lang.Object
    implements IndexTable
    A slow "index" that looks for data by searching linearly through a set. Only used when the indexed data contains fewer bound variables than expected. Note that this class is only used for a MINUS operation that is removing data with potentially unbound values, and is therefore rarely used. TODO: If this index starts to be used more often then consider various options for indexing on the known bound variables. One possibility is for each variable (found in commonVars) to take the value of a var/value pair and TreeMap this to a set of Bindings that it occurs in. This would offer a reduced set to search, and set intersections may also work (intersections like this could be done on Binding reference equality rather than value). TreeMap is suggested here, since there would be commonVars.size() maps, which would take a lot of heap, particularly since performance of this class is only an issue when the data to search is significant.
    • Method Detail

      • containsCompatibleWithSharedDomain

        public boolean containsCompatibleWithSharedDomain​(Binding bindingLeft)
        Description copied from interface: IndexTable
        Is there a binding in the table that has a shared domain (variables in common) and is join-compatible? This is teh condition for MINUS to exclude the argument binding.
        Specified by:
        containsCompatibleWithSharedDomain in interface IndexTable
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object