Class StorageNodeDictionary<D1,C1,D2,C2,V,X extends StorageNodeMutable<D2,C2,V>>

java.lang.Object
org.aksw.commons.index.core.StorageNodeDictionary<D1,C1,D2,C2,V,X>
All Implemented Interfaces:
StorageNode<D1,C1,V>, StorageNodeMutable<D1,C1,V>

public class StorageNodeDictionary<D1,C1,D2,C2,V,X extends StorageNodeMutable<D2,C2,V>> extends Object implements StorageNodeMutable<D1,C1,V>
A wrapper for a storage node that adds a dictionary for the components Can be used to map e.g. Nodes to Integers or canonical instances Maybe this fits better on a TupleAccessor? The issue with storage nodes is that they are stateless. So if we wanted to wrap an exiting structure with a dictionary we would end up with: Dictionary<Alt3<...>, Map<Node, Integer> Probably it would not be too bad because we could still easily get the nested map structure out Actually, why shouldn't the storage node have a state? StorageNode<int[], int, ?> intStorage; TupleAccessor intAccessor; TupleAccessor tripleAccessor = TupleAccessorTriple.INSTANCE StorageNodeDictionary<Triple, Node, ?> tripleStorageWrapper = StorageNodeDictionary.wrap(intStorage, nodeAccessor, (dict, c) -> dict.size(), intAccessor) BiMap<Node, Integer> tripleStorageWrapper.getDictionary();
Author:
raven