Package org.anchoranalysis.mpp.io.input
Class OperationMap<T>
Object
org.anchoranalysis.mpp.io.input.OperationMap<T>
- Type Parameters:
T- the type of objects stored in the map
- All Implemented Interfaces:
MultiInputSubMap<T>
public class OperationMap<T> extends Object implements MultiInputSubMap<T>
Stores objects as operations in a map, implementing the
MultiInputSubMap interface.-
Constructor Summary
Constructors Constructor Description OperationMap() -
Method Summary
Modifier and Type Method Description voidadd(String name, StoreSupplier<T> op)Adds an entry to the map.voidaddToStore(NamedProviderStore<T> namedStore, Logger logger)Copies all the existing entries into aNamedProviderStore.StoreSupplier<T>get(String name)Retrieves an entry from the map.Map<String,StoreSupplier<T>>getMap()Retrieves the internal map storing the operations.
-
Constructor Details
-
OperationMap
public OperationMap()
-
-
Method Details
-
add
Description copied from interface:MultiInputSubMapAdds an entry to the map.- Specified by:
addin interfaceMultiInputSubMap<T>- Parameters:
name- the name of the entryop- the supplier for the entry's value
-
addToStore
public void addToStore(NamedProviderStore<T> namedStore, Logger logger) throws OperationFailedExceptionDescription copied from interface:MultiInputSubMapCopies all the existing entries into aNamedProviderStore.- Specified by:
addToStorein interfaceMultiInputSubMap<T>- Parameters:
namedStore- the store to copy the entries intologger- a logger for any non-fatal errors- Throws:
OperationFailedException- if a fatal error occurs during the copy process
-
get
Description copied from interface:MultiInputSubMapRetrieves an entry from the map.- Specified by:
getin interfaceMultiInputSubMap<T>- Parameters:
name- the name of the entry to retrieve- Returns:
- the
StoreSupplierfor the entry, or null if the entry doesn't exist - Throws:
OperationFailedException- if an error occurs while retrieving the entry
-
getMap
Retrieves the internal map storing the operations.- Returns:
- the map of operations
-