KeyType - class type of keys.ValueType - class type of values.public class StorageComponent<KeyType,ValueType> extends Object
| Constructor and Description |
|---|
StorageComponent() |
StorageComponent(ValueType value,
KeyType... keys)
Instantiation a StorageComponent instance, and story given value by given
keys.
|
| Modifier and Type | Method and Description |
|---|---|
int |
componentSize()
Returns the number of key-value mappings in this StorageComponent
Component.
|
ValueType |
get(KeyType... keys)
Returns value of keys reference.
|
ValueType |
get(KeyType key)
Returns value of key reference.
|
StorageComponent<KeyType,ValueType> |
getStorageComponent(KeyType key)
Returns child StorageComponent by given key.
|
Set<KeyType> |
keySet()
Returns a Set view of the keys contained in this StorageComponent.
|
void |
put(ValueType value,
KeyType... keys)
Storages the value by keys.
|
void |
put(ValueType value,
KeyType key)
Storages the value by key.
|
int |
size()
Returns the number of key-value mappings in this StorageComponent.
|
String |
toString() |
Collection<ValueType> |
values()
Returns a Collection view of the values contained in this
StorageComponent.
|
public ValueType get(KeyType... keys)
keys - the keys to get value.public ValueType get(KeyType key)
key - the key to get value.public Set<KeyType> keySet()
public Collection<ValueType> values()
public int size()
public int componentSize()
public void put(ValueType value, KeyType... keys)
value - the value to storage.keys - the keys to storage value.public void put(ValueType value, KeyType key)
value - the value to storage.key - the key to storage value.public StorageComponent<KeyType,ValueType> getStorageComponent(KeyType key)
key - the key of children StorageComponent.Copyright © 2014. All rights reserved.