Class PlotCommandFormatter

java.lang.Object
uk.ac.starlink.ttools.task.CommandFormatter
uk.ac.starlink.ttools.plot2.task.PlotCommandFormatter

public class PlotCommandFormatter extends CommandFormatter
Handles export of PlotStiltsCommand objects to external serialization formats.
Since:
15 Sep 2017
Author:
Mark Taylor
  • Constructor Details

    • PlotCommandFormatter

      public PlotCommandFormatter(CredibleString invocation, boolean includeDflts, LineEnder lineEnder, int levelIndent, int cwidth)
      Constructor.
      Parameters:
      invocation - display text to introduce the STILTS command
      includeDflts - if true, all parameters are included; if false, only those with non-default values
      lineEnder - line end presentation policy
      levelIndent - number of spaces per indentation level
      cwidth - nominal formatting width in characters; this affects line wrapping, but actual wrapping may depend on other factors too
  • Method Details

    • stripExpectedUnused

      protected String[] stripExpectedUnused(uk.ac.starlink.task.Task task, String[] words)
      Description copied from class: CommandFormatter
      Remove words from the list of unused words that are harmless.

      This is a hook for a hack. Some of the parameter settings can be unused when object values for other parameter settings are used. If that happens, it looks like there is a problem because settings have not been used. This routine can pull them out so the warning goes away.

      Overrides:
      stripExpectedUnused in class CommandFormatter
      Parameters:
      task - task
      words - input command word list
      Returns:
      list apart from any words that shouldn't be there