Class AbstractTinkerIndex<T extends Element>

  • Type Parameters:
    T - type of Element to be indexed

    public abstract class AbstractTinkerIndex<T extends Element>
    extends Object
    Storage for indexes that can be used by different implementations of AbstractTinkerGraph.
    Author:
    Valentyn Kahamlyk
    • Method Detail

      • get

        public abstract List<T> get​(String key,
                                    Object value)
        Get list of elements which have a property with the desired value.
        Parameters:
        key - property key
        value - property value
        Returns:
        list of elements
      • count

        public abstract long count​(String key,
                                   Object value)
        Get count of elements which have a property with the desired value.
        Parameters:
        key - property key
        value - property value
        Returns:
        count of elements
      • remove

        public abstract void remove​(String key,
                                    Object value,
                                    T element)
        Remove elements with some property from index. Convenient to use when removed only one property of an element.
        Parameters:
        key - property key
        value - property value
        element - changed element
      • removeElement

        public abstract void removeElement​(T element)
        Remove elements from all indexes. Can be used when element was deleted or has changed more than 1 property.
        Parameters:
        element - changed element
      • autoUpdate

        public abstract void autoUpdate​(String key,
                                        Object newValue,
                                        Object oldValue,
                                        T element)
        Update index for single property of element.
        Parameters:
        key - property key
        newValue - updated value of property
        oldValue - optional value of property before update
        element - changed element
      • createKeyIndex

        public abstract void createKeyIndex​(String key)
        Create new index
        Parameters:
        key - property key
      • dropKeyIndex

        public abstract void dropKeyIndex​(String key)
        Drop index
        Parameters:
        key - property key
      • getIndexedKeys

        public Set<String> getIndexedKeys()
        Get all index keys for Graph
        Returns:
        set of index keys
      • indexable

        public static Object indexable​(Object obj)
        Provides a way for an index to have a null value as ConcurrentHashMap will not allow a null key.