org.softamis.net.registry.impl
Class AbstractProvidingRegistry.MultiValueItemsStorage

java.lang.Object
  extended by org.softamis.net.registry.impl.AbstractProvidingRegistry.MultiValueItemsStorage
All Implemented Interfaces:
AbstractProvidingRegistry.ItemsStorage<K,V>
Enclosing class:
AbstractProvidingRegistry<K extends java.io.Serializable,V extends java.io.Serializable>

protected class AbstractProvidingRegistry.MultiValueItemsStorage
extends java.lang.Object
implements AbstractProvidingRegistry.ItemsStorage<K,V>


Nested Class Summary
protected  class AbstractProvidingRegistry.MultiValueItemsStorage.SimpleMapEntry<K extends java.io.Serializable,V extends java.io.Serializable>
           
 
Field Summary
protected  java.util.Map<K,java.util.List<V>> fOwnItems
          Items that were published by this provider registry
 
Constructor Summary
protected AbstractProvidingRegistry.MultiValueItemsStorage()
           
 
Method Summary
 boolean add(K aKey, V aValue)
          Adds value to the storage
 void clear()
          Clears all storage content
 java.util.List<java.util.Map.Entry<K,V>> getItems()
          Returns list of entires for registered items
 java.util.List<V> getItems(K aKey)
          Returns list of values which are registered under given key
protected  boolean isItemNotRegistrered(K aItemKey, V aItem)
          Methods checks whether given item was already registred under given key
 boolean isMultiValued()
          Allows to check whether storage allows to store several values under the same key
 void remove(K aKey)
          Removes items stored under given key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fOwnItems

protected final java.util.Map<K extends java.io.Serializable,java.util.List<V extends java.io.Serializable>> fOwnItems
Items that were published by this provider registry

Constructor Detail

AbstractProvidingRegistry.MultiValueItemsStorage

protected AbstractProvidingRegistry.MultiValueItemsStorage()
Method Detail

add

public boolean add(K aKey,
                   V aValue)
Description copied from interface: AbstractProvidingRegistry.ItemsStorage
Adds value to the storage

Specified by:
add in interface AbstractProvidingRegistry.ItemsStorage<K extends java.io.Serializable,V extends java.io.Serializable>
Parameters:
aKey - key of item
aValue - value of item
Returns:
true if item was actually added to storage, false otherwise

getItems

public java.util.List<V> getItems(K aKey)
Description copied from interface: AbstractProvidingRegistry.ItemsStorage
Returns list of values which are registered under given key

Specified by:
getItems in interface AbstractProvidingRegistry.ItemsStorage<K extends java.io.Serializable,V extends java.io.Serializable>
Parameters:
aKey - key of item
Returns:
list of items

isItemNotRegistrered

protected boolean isItemNotRegistrered(K aItemKey,
                                       V aItem)
Methods checks whether given item was already registred under given key

Parameters:
aItemKey - key of item to register
aItem - the item itself
Returns:
true if item was not registered, false otherwise

getItems

public java.util.List<java.util.Map.Entry<K,V>> getItems()
Description copied from interface: AbstractProvidingRegistry.ItemsStorage
Returns list of entires for registered items

Specified by:
getItems in interface AbstractProvidingRegistry.ItemsStorage<K extends java.io.Serializable,V extends java.io.Serializable>

remove

public void remove(K aKey)
Description copied from interface: AbstractProvidingRegistry.ItemsStorage
Removes items stored under given key

Specified by:
remove in interface AbstractProvidingRegistry.ItemsStorage<K extends java.io.Serializable,V extends java.io.Serializable>
Parameters:
aKey - key of item

isMultiValued

public boolean isMultiValued()
Description copied from interface: AbstractProvidingRegistry.ItemsStorage
Allows to check whether storage allows to store several values under the same key

Specified by:
isMultiValued in interface AbstractProvidingRegistry.ItemsStorage<K extends java.io.Serializable,V extends java.io.Serializable>
Returns:
true if several values could be registered on the same key

clear

public void clear()
Description copied from interface: AbstractProvidingRegistry.ItemsStorage
Clears all storage content

Specified by:
clear in interface AbstractProvidingRegistry.ItemsStorage<K extends java.io.Serializable,V extends java.io.Serializable>