Package loci.formats
Class ResourceNamer
java.lang.Object
loci.formats.ResourceNamer
Utility class helping with generating human-readable resource names
based on alphanumeric indexing.
- Since:
- 5.0
- Author:
- Blazej Pindelski, bpindelski at dundee.ac.uk
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intalphabeticIndexCount(String index) Returns aStringrepresenting a single letter (in the case where the class instance has been initialized with a resource count lower than 26) or a concatenation of two letters (if resource count is higher than 26).loci.common.LocationgetLocationFromResourceName(loci.common.Location resourceParentPath, String resourceName, int nameIndex, String resourceExtension) Creates a newLocationinstance using the provided parent path and child node name.voidIncrements the internal alphabet pointer to the next element of the alphabet.voidResets the internal state of the class so that it starts alphabet generation from the first letter (ASCII A).
-
Field Details
-
PLATE
- See Also:
-
RUN
- See Also:
-
WELL
- See Also:
-
FIELD
- See Also:
-
FAKE_EXT
- See Also:
-
DOT
- See Also:
-
ALPHABET_LENGTH
private static final int ALPHABET_LENGTH- See Also:
-
resourceCount
private int resourceCount -
letter
private char letter -
tmpLetter
private char tmpLetter
-
-
Constructor Details
-
ResourceNamer
public ResourceNamer(int resourceCount)
-
-
Method Details
-
getLocationFromResourceName
public loci.common.Location getLocationFromResourceName(loci.common.Location resourceParentPath, String resourceName, int nameIndex, String resourceExtension) Creates a newLocationinstance using the provided parent path and child node name. Concatenates the child name with a numerical index that acts as an incrementing counter of node elements.- Parameters:
resourceParentPath- Path to the parent element.resourceName- Template string used for naming the child resource.nameIndex- Numerical value used for naming the child resource.resourceExtension- Optional extension (if the child resource is a file) or path separator (if folder).- Returns:
LocationNew instance representing the parent and child resources.
-
restartAlphabet
public void restartAlphabet()Resets the internal state of the class so that it starts alphabet generation from the first letter (ASCII A). -
nextLetter
public void nextLetter()Increments the internal alphabet pointer to the next element of the alphabet. -
getLetter
Returns aStringrepresenting a single letter (in the case where the class instance has been initialized with a resource count lower than 26) or a concatenation of two letters (if resource count is higher than 26).- Returns:
- See above.
-
alphabeticIndexCount
-