Package org.anchoranalysis.annotation.io
Class AnnotationWithStrategy<T extends AnnotatorStrategy>
- Type Parameters:
T
- type of annotation-strategy.
- All Implemented Interfaces:
InputFromManager
public class AnnotationWithStrategy<T extends AnnotatorStrategy>
extends InputFromManagerDelegate<ProvidesStackInput>
One particular annotation, associated with its strategy.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationWithStrategy
(ProvidesStackInput input, T strategy) Creates for a particular input and associated annotation strategy. -
Method Summary
Modifier and TypeMethodDescriptionThe file associated with the annotation, if such a file exists.getPath()
Path to annotation.The strategy on how annotation occurs.label
(OperationContext context) A human-friendly textual description of the annotation, orOptional.empty()
if no label is available.All stacks associated with the input, lazily evaluated.Methods inherited from class org.anchoranalysis.io.input.InputFromManagerDelegate
close, getDelegate, identifier, pathForBinding, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.anchoranalysis.io.input.InputFromManager
allAssociatedPaths, asFile, identifierAsPath, pathForBindingRequired
-
Constructor Details
-
AnnotationWithStrategy
Creates for a particular input and associated annotation strategy.- Parameters:
input
- the input.strategy
- the strategy.- Throws:
OperationFailedException
- if a path cannot be determined bystrategy
for the respectiveinput
.
-
-
Method Details
-
associatedFile
The file associated with the annotation, if such a file exists.- Returns:
- the file, if it exists.
-
label
A human-friendly textual description of the annotation, orOptional.empty()
if no label is available.- Parameters:
context
- context for reading a stack from the file-system.- Returns:
- the label, if available.
- Throws:
OperationFailedException
- if a label cannot be successfully determined.
-
stacks
All stacks associated with the input, lazily evaluated.The stacks are cached the first time they are evaluated, to avoid repeated computation.
- Parameters:
logger
- a logger for any non-fatal errors. Fatal errors throw an exception.- Returns:
- a supplier of the stacks.
-
getStrategy
The strategy on how annotation occurs. -
getPath
Path to annotation.
-