Class IndexableOutputNameStyle

Object
OutputNameStyle
IndexableOutputNameStyle
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IntegerSuffixOutputNameStyle, StringSuffixOutputNameStyle

public abstract class IndexableOutputNameStyle extends OutputNameStyle
An output-name with an index somehow appended or prepended in a particular style.

The no-arguments constructor exists only for deserialization.

Author:
Owen Feehan
See Also:
  • Constructor Details

    • IndexableOutputNameStyle

      protected IndexableOutputNameStyle()
      Empty constructor, as needed for deserialization.
    • IndexableOutputNameStyle

      protected IndexableOutputNameStyle(String outputName)
      Creates with an output-name.
      Parameters:
      outputName - the output-name.
    • IndexableOutputNameStyle

      protected IndexableOutputNameStyle(IndexableOutputNameStyle source)
      Copy constructor.
      Parameters:
      source - source.
  • Method Details

    • filenameWithoutExtension

      public String filenameWithoutExtension(int index)
      Like filenameWithoutExtension() but incorporates an integer index.
      Parameters:
      index - the index, unique within a set of filenames being outputted.
      Returns:
      the filename (without an extension, including without the period before the extension).
    • filenameWithoutExtension

      public String filenameWithoutExtension(String index)
      Like filenameWithoutExtension() but incorporates an string index.
      Parameters:
      index - the index
      Returns:
      the filename (without an extension, including without the period before the extension).
    • duplicate

      public abstract IndexableOutputNameStyle duplicate()
      Description copied from class: OutputNameStyle
      Deep copy the current object.
      Specified by:
      duplicate in class OutputNameStyle
      Returns:
      a newly created copy.
    • filenameWithoutExtension

      public Optional<String> filenameWithoutExtension()
      Description copied from class: OutputNameStyle
      The filename to be written, including prefix, suffix, etc. but excluding extension (and any period before the extension).
      Specified by:
      filenameWithoutExtension in class OutputNameStyle
      Returns:
      the filename (without an extension, including without the period before the extension), if one is defined. If one is not defined, the output is expected to occur without any filename.
    • filenameFromOutputFormatString

      protected abstract String filenameFromOutputFormatString(String outputFormatString, String index)
      Constructs a file name from the output format string and an index.
      Parameters:
      outputFormatString - a format-string as recognized by String.format(java.lang.String, java.lang.Object...) that expects a single string element (what will be populated by index) to form the name.
      index - the index, unique within a set of filenames being outputted.
      Returns:
      the file-name as a string.
    • outputFormatString

      protected abstract String outputFormatString()
      A format-string as recognized by String.format(java.lang.String, java.lang.Object...) that expects a single string element.
      Returns:
      the format-string.