Class CacheTransferSource<T extends FeatureInput>

Object
org.anchoranalysis.feature.session.cache.finder.CacheTransferSource<T>
Type Parameters:
T - input-type associated with cache

public class CacheTransferSource<T extends FeatureInput>
extends Object
An existing cache that can be used as a source for child-caches elsewhere.
Author:
Owen Feehan
  • Constructor Details

  • Method Details

    • containsChild

      public boolean containsChild​(ChildCacheName name)
      Whether a particular child-cache exists in the source?
      Parameters:
      name - the name of the child-cache.
      Returns:
      true iff the child-cache exists.
    • getInputIfPresent

      public Optional<FeatureCalculationInput<T>> getInputIfPresent​(T input) throws org.anchoranalysis.core.exception.OperationFailedException
      Gets corresponding FeatureCalculationInput for an input, if present, but doesn't create any new entry if it's absent.
      Parameters:
      input - the input.
      Returns:
      an existing element if present or Optional.empty() otherwise.
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException - if unable to get the cache that is searched.
    • getCacheNames

      public Set<ChildCacheName> getCacheNames()
      The names of the child-caches that can be used as sources.
      Returns:
      the names, as a set, which should not be modified (i.e. treated as read-only).