Package loci.formats
Class FilePatternBlock
java.lang.Object
loci.formats.FilePatternBlock
FilePatternBlock represents a single block in a
FilePattern.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BigIntegerprivate StringString representation of this block.static final StringIdentifies the end of a block.static final StringIdentifies the start of a block.private String[]Elements within this block, e.g.private BigIntegerprivate booleanWhether or not this is a fixed-width block.private booleanWhether or not this is a numeric block.private BigIntegerprivate intThe number of leading zeroes. -
Constructor Summary
ConstructorsConstructorDescriptionFilePatternBlock(String block) Builds a FilePatternBlock from a block string. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidexplode()getBlock()Gets the block string.String[]Gets all block elements.getFirst()Gets the first element in a range block.getLast()Gets the last element in a range block.getStep()Gets the difference between consecutive elements in a range block.booleanisFixed()Whether or not this is a fixed-width block.booleanWhether or not this is a numeric block.private voidsetFixed()private voidprivate voidthrowBadBlock(String msgTemplate) private voidthrowBadBlock(String msgTemplate, Throwable cause)
-
Field Details
-
BLOCK_START
Identifies the start of a block.- See Also:
-
BLOCK_END
Identifies the end of a block.- See Also:
-
elements
Elements within this block, e.g. ["R", "G", "B"] or ["1", "2", "3"]. -
fixed
private boolean fixedWhether or not this is a fixed-width block. -
numeric
private boolean numericWhether or not this is a numeric block. -
zeroes
private int zeroesThe number of leading zeroes. -
block
String representation of this block. -
begin
-
end
-
step
-
-
Constructor Details
-
FilePatternBlock
Builds a FilePatternBlock from a block string. SeeFilePatternfor block string syntax.- Parameters:
block- the block string.
-
-
Method Details
-
getElements
Gets all block elements.- Returns:
- an array containing all block elements.
-
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 to10, 13, 15, all of which consist only of digits.- Returns:
- true if this is a numeric block, false otherwise.
-
getFirst
Gets the first element in a range block.- Returns:
- the first block element
-
getLast
Gets the last element in a range block.- Returns:
- the last block element
-
getStep
Gets the difference between consecutive elements in a range block.- Returns:
- the step element as defined above.
-
throwBadBlock
-
throwBadBlock
-
setNumeric
private void setNumeric() -
setFixed
private void setFixed() -
explode
private void explode()
-