loci.formats

## Class FilePatternBlock

- java.lang.Object
- - loci.formats.FilePatternBlock

-     public class FilePatternBlock
      extends java.lang.Object

  FilePatternBlock represents a single block in a `FilePattern`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.math.BigInteger` | `begin`
    `private java.lang.String` | `block` String representation of this block.
    `static java.lang.String` | `BLOCK_END` Identifies the end of a block.
    `static java.lang.String` | `BLOCK_START` Identifies the start of a block.
    `private java.lang.String[]` | `elements` Elements within this block, e.g.
    `private java.math.BigInteger` | `end`
    `private boolean` | `fixed` Whether or not this is a fixed-width block.
    `private boolean` | `numeric` Whether or not this is a numeric block.
    `private java.math.BigInteger` | `step`
    `private int` | `zeroes` The number of leading zeroes.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilePatternBlock(java.lang.String block)` Builds a FilePatternBlock from a block string.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `explode()`
    `java.lang.String` | `getBlock()` Gets the block string.
    `java.lang.String[]` | `getElements()` Gets all block elements.
    `java.math.BigInteger` | `getFirst()` Gets the first element in a range block.
    `java.math.BigInteger` | `getLast()` Gets the last element in a range block.
    `java.math.BigInteger` | `getStep()` Gets the difference between consecutive elements in a range block.
    `boolean` | `isFixed()` Whether or not this is a fixed-width block.
    `boolean` | `isNumeric()` Whether or not this is a numeric block.
    `private void` | `setFixed()`
    `private void` | `setNumeric()`
    `private void` | `throwBadBlock(java.lang.String msgTemplate)`
    `private void` | `throwBadBlock(java.lang.String msgTemplate, java.lang.Throwable cause)`

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

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

- - ### Field Detail

    - #### BLOCK_START

          public static final java.lang.String BLOCK_START

      Identifies the start of a block.
      See Also:
        Constant Field Values

    - #### BLOCK_END

          public static final java.lang.String BLOCK_END

      Identifies the end of a block.
      See Also:
        Constant Field Values

    - #### elements

          private java.lang.String[] elements

      Elements within this block, e.g. ["R", "G", "B"] or ["1", "2", "3"].

    - #### fixed

          private boolean fixed

      Whether or not this is a fixed-width block.

    - #### numeric

          private boolean numeric

      Whether or not this is a numeric block.

    - #### zeroes

          private int zeroes

      The number of leading zeroes.

    - #### block

          private java.lang.String block

      String representation of this block.

    - #### begin

          private java.math.BigInteger begin

    - #### end

          private java.math.BigInteger end

    - #### step

          private java.math.BigInteger step

  - ### Constructor Detail

    - #### FilePatternBlock

          public FilePatternBlock(java.lang.String block)

      Builds a FilePatternBlock from a block string. See `FilePattern` for block string syntax.
      Parameters:
        `block` - the block string.

  - ### Method Detail

    - #### getElements

          public java.lang.String[] getElements()

      Gets all block elements.
      Returns:
        an array containing all block elements.

    - #### getBlock

          public java.lang.String getBlock()

      Gets the block string.
      Returns:
        the block string.

    - #### isFixed

          public boolean isFixed()

      Whether or not this is a fixed-width block. All elements in a fixed-width block have the same length (numbers are zero-padded as needed).
      Returns:
        true if this is a fixed-width block, false otherwise.

    - #### isNumeric

          public boolean isNumeric()

      Whether or not this is a numeric block. All elements in a numeric block consist of digit characters. For instance, `<10-15:2>` expands to `10, 13, 15`, all of which consist only of digits.
      Returns:
        true if this is a numeric block, false otherwise.

    - #### getFirst

          public java.math.BigInteger getFirst()

      Gets the first element in a range block.
      Returns:
        the first block element

    - #### getLast

          public java.math.BigInteger getLast()

      Gets the last element in a range block.
      Returns:
        the last block element

    - #### getStep

          public java.math.BigInteger getStep()

      Gets the difference between consecutive elements in a range block.
      Returns:
        the step element as defined above.

    - #### throwBadBlock

          private void throwBadBlock(java.lang.String msgTemplate)

    - #### throwBadBlock

          private void throwBadBlock(java.lang.String msgTemplate,
                                     java.lang.Throwable cause)

    - #### setNumeric

          private void setNumeric()

    - #### setFixed

          private void setFixed()

    - #### explode

          private void explode()

Copyright © 2026 Open Microscopy Environment