Package loci.formats

Class FilePatternBlock

java.lang.Object
loci.formats.FilePatternBlock

public class FilePatternBlock extends Object
FilePatternBlock represents a single block in a FilePattern.
  • Field Details

    • BLOCK_START

      public static final String BLOCK_START
      Identifies the start of a block.
      See Also:
    • BLOCK_END

      public static final String BLOCK_END
      Identifies the end of a block.
      See Also:
    • elements

      private 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 String block
      String representation of this block.
    • begin

      private BigInteger begin
    • end

      private BigInteger end
    • step

      private BigInteger step
  • Constructor Details

    • FilePatternBlock

      public FilePatternBlock(String block)
      Builds a FilePatternBlock from a block string. See FilePattern for block string syntax.
      Parameters:
      block - the block string.
  • Method Details

    • getElements

      public String[] getElements()
      Gets all block elements.
      Returns:
      an array containing all block elements.
    • getBlock

      public 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 BigInteger getFirst()
      Gets the first element in a range block.
      Returns:
      the first block element
    • getLast

      public BigInteger getLast()
      Gets the last element in a range block.
      Returns:
      the last block element
    • getStep

      public BigInteger getStep()
      Gets the difference between consecutive elements in a range block.
      Returns:
      the step element as defined above.
    • throwBadBlock

      private void throwBadBlock(String msgTemplate)
    • throwBadBlock

      private void throwBadBlock(String msgTemplate, Throwable cause)
    • setNumeric

      private void setNumeric()
    • setFixed

      private void setFixed()
    • explode

      private void explode()