Class FileNamerIndependent
- Direct Known Subclasses:
FromOutputName
,LastDirectories
,NormalizedPath
,RegExMatcher
,RelativeToDirectory
Base class for methods that derive the name independently for each file.
By independently, this means the name is derived using information from a particular file only, and not from the collective set of the files that are named together.
An exception may occur via the index, which is derived collectively from all files, but may be used in sub-classes.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
deriveName
(File file, Optional<Path> inputDirectory, int index) Derives a unique name for this file.deriveName
(List<File> files, FileNamerContext context) Derives a list of names (associated with each file) for some files.Methods inherited from class org.anchoranalysis.io.input.bean.namer.FileNamer
deriveName, deriveNameUnique
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
FileNamerIndependent
public FileNamerIndependent()
-
-
Method Details
-
deriveName
Description copied from class:FileNamer
Derives a list of names (associated with each file) for some files.- Specified by:
deriveName
in classFileNamer
- Parameters:
files
- the files to describe.context
- additional context for naming.- Returns:
- a list of identical size and order to files, corresponding to the file the extracted name.
-
deriveName
protected abstract String deriveName(File file, Optional<Path> inputDirectory, int index) throws CreateException Derives a unique name for this file.- Parameters:
file
- the file.inputDirectory
- the root input-directory used in naming.index
- a unique incrementing number, beginning at zero, passed to each call to this method within a collection.- Returns:
- the derived unique name.
- Throws:
CreateException
- if unable to create the unique name.
-