org.aksw.commons.collections.FeatureMap Maven / Gradle / Ivy
package org.aksw.commons.collections;
import java.util.Collection;
import java.util.Map.Entry;
import java.util.Set;
import java.util.function.BiConsumer;
/**
* A feature map associates a set of features with
* items. Multiple items may have exactly the same features.
*
* Hence, this class is called FeatureMap for brevity, but is actually as Feature*Multi*Map.
* Multimaps can be represented as Collections of entries; i.e. adding multiple entries with the same key is valid.
*
*
* @author raven
*
* @param
* @param
*/
public interface FeatureMap
extends Collection, V>>
//extends Map, Collection>
//extends Multimap, V>
{
default void forEach(BiConsumer, V> consumer) {
this.forEach(e -> consumer.accept(e.getKey(), e.getValue()));
}
void put(Set tagSet, V value);
boolean remove(Object tagSet);
boolean removeValue(Object value);
Set> keySet();
Collection values();
Set, Collection>> entrySet();
// Get all items having exactly the specified feature set
Collection get(Set prototype);
Set> getTagSets(Object v);
/**
*
* @param prototye
* @return
*/
Collection, V>> getIfSupersetOf(Set prototype);
Collection, V>> getIfSubsetOf(Set prototype);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy