/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira.drafts
 */
package net.ranides.assira.collections.map;

import java.util.Collection;
import java.util.Comparator;
import java.util.function.Consumer;
import java.util.function.Function;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface IndexMap<V> {

    IndexMap<V> index(String name, Comparator<V> index);
    
    <T> IndexMap<V> index(String name, Function<V,T> index);
    
    
    
    IndexQuery<V> find();

    IndexQuery<V> find(Comparator<V> index, V value);
    
    <T> IndexQuery<V> find(Function<V,T> index, T value);

    IndexQuery<V> find(String index, V value);

    
    
    void put(V value);

    void put(Collection<? extends V> values);

    void update(V value, Consumer<? super V> consumer);
    
    void updateAll();
    
    
    
    void remove(Comparator<V> index, V value);
    
    <T> void remove(Function<V,T> index, T value);

    void remove(String index, V value);
    
    void remove(V value);
    
    void removeAll(Collection<V> values);

    void clear();

}
