Class DefaultIndex

    • Constructor Detail

      • DefaultIndex

        protected DefaultIndex​(@NonNull
                               List<? extends IKeyField> keyFields)
        Construct a new index.
        Parameters:
        keyFields - the key field components to use to generate keys by default
    • Method Detail

      • getKeyFields

        public List<IKeyFieldgetKeyFields()
        Description copied from interface: IIndex
        Retrieve the key field components used to generate a key for this index.
        Specified by:
        getKeyFields in interface IIndex
        Returns:
        the key field components
      • put

        public INodeItem put​(@NonNull
                             INodeItem item,
                             @NonNull
                             List<String> key)
        Description copied from interface: IIndex
        Store the provided item using the provided key.
        Specified by:
        put in interface IIndex
        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

        public INodeItem get​(List<String> key)
        Description copied from interface: IIndex
        Retrieve the item from the index that matches the provided key.
        Specified by:
        get in interface IIndex
        Parameters:
        key - the key to use for lookup
        Returns:
        the item with the matching key or null if no matching item was found