Class PropertyIndexLookup


  • public class PropertyIndexLookup
    extends java.lang.Object
    Is responsible for querying the property index content.
    This class can be used directly on a subtree where there is an index defined by supplying a NodeState root.
    
     {
         NodeState state = ... // get a node state
         PropertyIndexLookup lookup = new PropertyIndexLookup(state);
         Set<String> hits = lookup.find("foo", PropertyValues.newString("xyz"));
     }
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double COST_OVERHEAD
      The cost overhead to use the index in number of read operations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getCost​(Filter filter, java.lang.String propertyName, PropertyValue value)  
      boolean isIndexed​(java.lang.String propertyName, java.lang.String path, Filter filter)
      Checks whether the named property is indexed somewhere along the given path.
      java.lang.Iterable<java.lang.String> query​(Filter filter, java.lang.String propertyName, PropertyValue value)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COST_OVERHEAD

        public static final double COST_OVERHEAD
        The cost overhead to use the index in number of read operations.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PropertyIndexLookup

        public PropertyIndexLookup​(NodeState root)
    • Method Detail

      • isIndexed

        public boolean isIndexed​(java.lang.String propertyName,
                                 java.lang.String path,
                                 Filter filter)
        Checks whether the named property is indexed somewhere along the given path. Lookup starts at the current path (at the root of this object) and traverses down the path.
        Parameters:
        propertyName - property name
        path - lookup path
        filter - for the node type restriction (null if no node type restriction)
        Returns:
        true if the property is indexed
      • query

        public java.lang.Iterable<java.lang.String> query​(Filter filter,
                                                          java.lang.String propertyName,
                                                          PropertyValue value)
      • getCost

        public double getCost​(Filter filter,
                              java.lang.String propertyName,
                              PropertyValue value)