loci.formats

## Class ResourceNamer

- java.lang.Object
- - loci.formats.ResourceNamer

-     public class ResourceNamer
      extends java.lang.Object

  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
    Modifier and Type | Field and Description
    --- | ---
    `private static int` | `ALPHABET_LENGTH`
    `static java.lang.String` | `DOT`
    `static java.lang.String` | `FAKE_EXT`
    `static java.lang.String` | `FIELD`
    `private char` | `letter`
    `static java.lang.String` | `PLATE`
    `private int` | `resourceCount`
    `static java.lang.String` | `RUN`
    `private char` | `tmpLetter`
    `static java.lang.String` | `WELL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceNamer(int resourceCount)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `alphabeticIndexCount(java.lang.String index)`
    `java.lang.String` | `getLetter()` Returns a `String` representing 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.Location` | `getLocationFromResourceName(loci.common.Location resourceParentPath, java.lang.String resourceName, int nameIndex, java.lang.String resourceExtension)` Creates a new `Location` instance using the provided parent path and child node name.
    `void` | `nextLetter()` Increments the internal alphabet pointer to the next element of the alphabet.
    `void` | `restartAlphabet()` Resets the internal state of the class so that it starts alphabet generation from the first letter (ASCII A).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PLATE

          public static final java.lang.String PLATE

      See Also:
        Constant Field Values

    - #### RUN

          public static final java.lang.String RUN

      See Also:
        Constant Field Values

    - #### WELL

          public static final java.lang.String WELL

      See Also:
        Constant Field Values

    - #### FIELD

          public static final java.lang.String FIELD

      See Also:
        Constant Field Values

    - #### FAKE_EXT

          public static final java.lang.String FAKE_EXT

      See Also:
        Constant Field Values

    - #### DOT

          public static final java.lang.String DOT

      See Also:
        Constant Field Values

    - #### ALPHABET_LENGTH

          private static final int ALPHABET_LENGTH

      See Also:
        Constant Field Values

    - #### resourceCount

          private int resourceCount

    - #### letter

          private char letter

    - #### tmpLetter

          private char tmpLetter

  - ### Constructor Detail

    - #### ResourceNamer

          public ResourceNamer(int resourceCount)

  - ### Method Detail

    - #### getLocationFromResourceName

          public loci.common.Location getLocationFromResourceName(loci.common.Location resourceParentPath,
                                                                  java.lang.String resourceName,
                                                                  int nameIndex,
                                                                  java.lang.String resourceExtension)

      Creates a new `Location` instance 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:
        `Location` New 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

          public java.lang.String getLetter()

      Returns a `String` representing 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

          public static int alphabeticIndexCount(java.lang.String index)

Copyright © 2026 Open Microscopy Environment