Interface IIndex

    • Method Detail

      • newInstance

        @NonNull
        static IIndex newInstance​(@NonNull
                                  List<? extends IKeyField> keyFields)
        Construct a new index using the provided key field components to generate keys.
        Parameters:
        keyFields - the key field components to use to generate keys by default
        Returns:
        the new index
      • isAllNulls

        static boolean isAllNulls​(@NonNull
                                  Iterable<String> key)
        Check if a key contains information other than null Strings.
        Parameters:
        key - the key to check
        Returns:
        true if the series of key values contains only null values, or false otherwise
      • getKeyFields

        @NonNull
        List<IKeyFieldgetKeyFields()
        Retrieve the key field components used to generate a key for this index.
        Returns:
        the key field components
      • put

        @Nullable
        default INodeItem put​(@NonNull
                              INodeItem item,
                              @NonNull
                              DynamicContext dynamicContext)
        Store the provided item in the index using the index's key field components to generate the key.
        Parameters:
        item - the item to store in the index
        dynamicContext - the Metapath evaluation context
        Returns:
        the previous item stored in the index, or null otherwise
      • put

        @Nullable
        INodeItem put​(@NonNull
                      INodeItem item,
                      @NonNull
                      List<String> key)
        Store the provided item using the provided key.
        Parameters:
        item - the item to store
        key - the key to store the item with
        Returns:
        the previous item stored in the index using the key, or null otherwise
      • get

        @Nullable
        default INodeItem get​(@NonNull
                              INodeItem item,
                              @NonNull
                              DynamicContext dynamicContext)
        Retrieve the item from the index that matches the key generated by evaluating the index's default key field components against the provided item.
        Parameters:
        item - the item to store in the index
        dynamicContext - the Metapath evaluation context
        Returns:
        the previous item stored in the index, or null otherwise
      • get

        INodeItem get​(List<String> key)
        Retrieve the item from the index that matches the provided key.
        Parameters:
        key - the key to use for lookup
        Returns:
        the item with the matching key or null if no matching item was found
      • toKey

        @NonNull
        static List<StringtoKey​(@NonNull
                                  INodeItem item,
                                  @NonNull
                                  List<? extends IKeyField> keyFields,
                                  @NonNull
                                  DynamicContext dynamicContext)
        Construct a key by evaluating the provided key field components against the provided item.
        Parameters:
        item - the item to generate the key from
        keyFields - the key field components used to generate the key
        dynamicContext - the Metapath evaluation context
        Returns:
        a new key