Package org.anchoranalysis.io.input.file
Class FileNamerContext
Object
org.anchoranalysis.io.input.file.FileNamerContext
public final class FileNamerContext extends Object
Provides useful additional objects when assigning a name to a file.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description FileNamerContext(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)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 Type Method Description booleanequals(Object o)StringgetElseName()A fallback name, if a failure occurs when naming.Optional<Path>getInputDirectory()A directory associated with the inputs, which if defined, is guaranteed to be a parent of them all.LoggergetLogger()Logs information messages.Optional<IndexRangeNegative>getNameSubrange()If defined, this indicates and specifies only a subset of the naming-elements to use.inthashCode()booleanisRelativeToDirectory()If true, the namer should prefer to derive file-names relative to the directory, rather than only the varying elements in the file-names.StringtoString()
-
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
-
-
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
-