Class ExtractFrameStore
Object
ExtractFrameStore
- All Implemented Interfaces:
NamedProvider<TimeSeries>
,NamedProviderStore<TimeSeries>
Exposes a
NamedProviderStore<TimeSeries>
as a NamedProviderStore<Stack>
by
extracting a frame from each series.- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionExtractFrameStore
(NamedProviderStore<Stack> stacks) Creates to extract at time-index 0.ExtractFrameStore
(NamedProviderStore<Stack> stacks, int timeIndex) Creates to extract at time-indextimeIndex
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(String identifier, StoreSupplier<TimeSeries> supplier) Adds an element to the store.getOptional
(String key) Retrieves the item if it exists, or returnsOptional.empty()
if it doesn't exist.keys()
Returns a set of keys associated with the provider.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.anchoranalysis.core.identifier.provider.NamedProvider
getArbitraryElement, getException, isEmpty
-
Constructor Details
-
ExtractFrameStore
Creates to extract at time-index 0.- Parameters:
stacks
- the underlying store ofStack
s.
-
ExtractFrameStore
Creates to extract at time-indextimeIndex
.- Parameters:
stacks
- the underlying store ofStack
s.timeIndex
- the time-index to extract from eachTimeSeries
.
-
-
Method Details
-
getOptional
Description copied from interface:NamedProvider
Retrieves the item if it exists, or returnsOptional.empty()
if it doesn't exist.Note that a 'key' might still throw an exception for another reason (but never because a particular key is absent).
- Specified by:
getOptional
in interfaceNamedProvider<TimeSeries>
- Parameters:
key
- a unique name for the item.- Returns:
- the item, if it exists, otherwise
Optional.empty()
. - Throws:
NamedProviderGetException
- if no item exists foridentifier
.
-
keys
Description copied from interface:NamedProvider
Returns a set of keys associated with the provider.There's no guarantee that it refers to all valid keys.
- Specified by:
keys
in interfaceNamedProvider<TimeSeries>
- Returns:
- a set of all keys associated with the provider.
-
add
public void add(String identifier, StoreSupplier<TimeSeries> supplier) throws OperationFailedException Description copied from interface:NamedProviderStore
Adds an element to the store.- Specified by:
add
in interfaceNamedProviderStore<TimeSeries>
- Parameters:
identifier
- a unique identifier for the element.supplier
- supplies the element to be added (which may be evaluated immediately, or a later point lazily).- Throws:
OperationFailedException
- if the identifier already exists, or otherwise the add operation fails.
-