Package org.anchoranalysis.io.input.file
Class FileNamerContext
Object
FileNamerContext
Provides useful additional objects when assigning a name to a file.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionFileNamerContext
(String elseName, Logger logger) Creates with a fallback-name and a logger, but otherwise using sensible defaults.FileNamerContext
(Optional<Path> inputDirectory, boolean relativeToDirectory, String elseName, Optional<IndexRangeNegative> nameSubrange, Logger logger) Creates a newFileNamerContext
instance.FileNamerContext
(Optional<Path> inputDirectory, boolean relativeToDirectory, Optional<IndexRangeNegative> nameSubrange, Logger logger) Creates with specific parameters.FileNamerContext
(Logger logger) Creates with a logger, and otherwise uses sensible defaults. -
Method Summary
Modifier and TypeMethodDescriptionboolean
A fallback name, if a failure occurs when naming.A directory associated with the inputs, which if defined, is guaranteed to be a parent of them all.Logs information messages.If defined, this indicates and specifies only a subset of the naming-elements to use.int
hashCode()
boolean
If true, the namer should prefer to derive file-names relative to the directory, rather than only the varying elements in the file-names.toString()
-
Constructor Details
-
FileNamerContext
Creates with a logger, and otherwise uses sensible defaults.- Parameters:
logger
- the logger.
-
FileNamerContext
public FileNamerContext(Optional<Path> inputDirectory, boolean relativeToDirectory, Optional<IndexRangeNegative> nameSubrange, Logger logger) Creates with specific parameters.- Parameters:
inputDirectory
- a directory associated with the inputs, which if defined, is guaranteed to be a parent of them all.relativeToDirectory
- if true, the namer should prefer to derive file-names relative to the directory, rather than only the varying elements in the file-names.nameSubrange
- if defined, this indicates and specifies only a subset of the naming-elements to use.logger
- the logger.
-
FileNamerContext
Creates with a fallback-name and a logger, but otherwise using sensible defaults.- Parameters:
elseName
- a fallback-name, if a failure occurs when naming.logger
- the logger.
-
FileNamerContext
public FileNamerContext(Optional<Path> inputDirectory, boolean relativeToDirectory, String elseName, Optional<IndexRangeNegative> nameSubrange, Logger logger) Creates a newFileNamerContext
instance.- Parameters:
inputDirectory
- A directory associated with the inputs, which if defined, is guaranteed to be a parent of them all.relativeToDirectory
- If true, the namer should prefer to derive file-names relative to the directory, rather than only the varying elements in the file-names.elseName
- A fallback name, if a failure occurs when naming.nameSubrange
- If defined, this indicates and specifies only a subset of the naming-elements to use.logger
- Logs information messages.
-
-
Method Details
-
getInputDirectory
A directory associated with the inputs, which if defined, is guaranteed to be a parent of them all. -
isRelativeToDirectory
public boolean isRelativeToDirectory()If true, the namer should prefer to derive file-names relative to the directory, rather than only the varying elements in the file-names. -
getElseName
A fallback name, if a failure occurs when naming. -
getNameSubrange
If defined, this indicates and specifies only a subset of the naming-elements to use. -
getLogger
Logs information messages. -
equals
-
hashCode
public int hashCode() -
toString
-