Package org.anchoranalysis.io.input.file
Class NamedFile
Object
NamedFile
A file with an associated unique name.
This is an immutable class.
The name is intended to be a compact unique identifier for a file (in a particular context).
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getFile()
The file.Unique identifier associated with the file.getPath()
The path ofgetFile()
.int
hashCode()
mapIdentifier
(BiFunction<String, File, String> function) Immutably renames the file, by assigning it a new identifier.toPath()
LikeFile.toPath()
.toString()
-
Constructor Details
-
NamedFile
Create with an identifier and a file.- Parameters:
identifier
- unique identifier associated with the file.file
- the file.
-
-
Method Details
-
getPath
The path ofgetFile()
.- Returns:
- the path
-
mapIdentifier
Immutably renames the file, by assigning it a new identifier.- Parameters:
function
- generates a new identifier from the existing identifier and file- Returns:
- a newly created file with the assigned identifier, but existing file.
-
toPath
LikeFile.toPath()
.- Returns:
- the path associated with the file.
-
getIdentifier
Unique identifier associated with the file. -
getFile
The file. -
equals
-
hashCode
public int hashCode() -
toString
-