Package ai.libs.jaicore.basic.kvstore
Class KVStoreCollectionTwoLayerPartition
- java.lang.Object
-
- ai.libs.jaicore.basic.kvstore.KVStoreCollectionTwoLayerPartition
-
- All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,KVStoreCollection>>>
public class KVStoreCollectionTwoLayerPartition extends java.lang.Object implements java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,KVStoreCollection>>>
Automatically partitions a KVStoreCollection in a two-layered fashion according to a first and second level key when KVStores or KVStoreCollections are added.
-
-
Constructor Summary
Constructors Constructor Description KVStoreCollectionTwoLayerPartition(java.lang.String firstLevelKey, java.lang.String secondLevelKey)Creates an empty two layer KVStorCollection partition.KVStoreCollectionTwoLayerPartition(java.lang.String firstLayerKey, java.lang.String secondLayerKey, KVStoreCollection collection)Creates an empty two layerKVStoreCollectionpartition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(org.api4.java.datastructure.kvstore.IKVStore store)Adds a signleKVStoreto thisKVStoreCollectionTwoLayerPartition.voidaddAll(KVStoreCollection collection)Adds an entireto this {@link KVStoreCollectionTwoLayerPartition}.java.util.Set<java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,KVStoreCollection>>>entrySet()java.util.Map<java.lang.String,java.util.Map<java.lang.String,KVStoreCollection>>getData()java.lang.StringgetFirstLayerKey()java.lang.StringgetSecondLayerKey()java.util.Iterator<java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,KVStoreCollection>>>iterator()
-
-
-
Constructor Detail
-
KVStoreCollectionTwoLayerPartition
public KVStoreCollectionTwoLayerPartition(java.lang.String firstLayerKey, java.lang.String secondLayerKey, KVStoreCollection collection)Creates an empty two layerKVStoreCollectionpartition.- Parameters:
firstLayerKey- The field name for the first level partition.secondLayerKey- The field name for the second level partition.collection- TheKVStoreCollectionto initialize this two-layer partition.
-
KVStoreCollectionTwoLayerPartition
public KVStoreCollectionTwoLayerPartition(java.lang.String firstLevelKey, java.lang.String secondLevelKey)Creates an empty two layer KVStorCollection partition.- Parameters:
firstLevelKey- The field name for the first level partition.secondLevelKey- The field name for the second level partition.
-
-
Method Detail
-
getData
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,KVStoreCollection>> getData()
-
add
public void add(org.api4.java.datastructure.kvstore.IKVStore store)
Adds a signleKVStoreto thisKVStoreCollectionTwoLayerPartition.- Parameters:
store-
-
addAll
public void addAll(KVStoreCollection collection)
Adds an entireto this {@link KVStoreCollectionTwoLayerPartition}.- Parameters:
collection- The collection to be added to this partition.
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,KVStoreCollection>>> entrySet()
- Returns:
- The set of entries of this partition.
-
iterator
public java.util.Iterator<java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,KVStoreCollection>>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.util.Map.Entry<java.lang.String,java.util.Map<java.lang.String,KVStoreCollection>>>
-
getFirstLayerKey
public java.lang.String getFirstLayerKey()
- Returns:
- The key name that is used to do the partition for the first layer.
-
getSecondLayerKey
public java.lang.String getSecondLayerKey()
- Returns:
- The key name that is used to do the partition for the second layer.
-
-