Class ReporterParser

java.lang.Object
cs350s22.component.ui.parser.ReporterParser
All Implemented Interfaces:
SubParser

public class ReporterParser extends Object implements SubParser
Reporter commands are responsible for creating reporters. The job of a reporter is to inform recipients of the value of a sensor based on a trigger event.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String[]
     
    private final int
     
    private final cs350s22.component.ui.parser.A_ParserHelper
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReporterParser(String[] args, cs350s22.component.ui.parser.A_ParserHelper parserHelper)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    changeReporter(cs350s22.support.Identifier id, ArrayList<cs350s22.support.Identifier> ids, int value)
    Creates reporter id that informs the recipients when the sensor value has changed by at least value.
    private void
    changeReporter(cs350s22.support.Identifier id, ArrayList<cs350s22.support.Identifier> ids, ArrayList<cs350s22.support.Identifier> groups, int value)
    Creates reporter id that informs the recipients when the sensor value has changed by at least value.
    private void
    frequencyReporter(cs350s22.support.Identifier id, ArrayList<cs350s22.support.Identifier> ids, int value)
    Creates reporter id that informs the recipients every value updates.
    private void
    frequencyReporter(cs350s22.support.Identifier id, ArrayList<cs350s22.support.Identifier> ids, ArrayList<cs350s22.support.Identifier> groups, int value)
    Creates reporter id that informs the recipients every value updates.
    void
    Method each sub parser is required to use to begin parsing their respective commands.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • args

      private final String[] args
    • parserHelper

      private final cs350s22.component.ui.parser.A_ParserHelper parserHelper
    • numOfCmdArgs

      private final int numOfCmdArgs
  • Constructor Details

    • ReporterParser

      public ReporterParser(String[] args, cs350s22.component.ui.parser.A_ParserHelper parserHelper)
      Constructor.
  • Method Details

    • parse

      public void parse() throws IOException
      Description copied from interface: SubParser
      Method each sub parser is required to use to begin parsing their respective commands.
      Specified by:
      parse in interface SubParser
      Throws:
      IOException - Invalid input.
    • changeReporter

      private void changeReporter(cs350s22.support.Identifier id, ArrayList<cs350s22.support.Identifier> ids, int value)
      Creates reporter id that informs the recipients when the sensor value has changed by at least value.
      Parameters:
      id - Name of the reporter object to be created.
      ids - Collection ids, if given, passed by the command.
      value - Value passed by command.
    • changeReporter

      private void changeReporter(cs350s22.support.Identifier id, ArrayList<cs350s22.support.Identifier> ids, ArrayList<cs350s22.support.Identifier> groups, int value)
      Creates reporter id that informs the recipients when the sensor value has changed by at least value.
      Parameters:
      id - Name of the reporter object to be created.
      ids - Collection ids who are informed in relation to the value.
      groups - Collection groups who are informed in relation to the value.
      value - The value that dictates when the reporter acts.
    • frequencyReporter

      private void frequencyReporter(cs350s22.support.Identifier id, ArrayList<cs350s22.support.Identifier> ids, int value)
      Creates reporter id that informs the recipients every value updates.
      Parameters:
      id - Name of the reporter object to be created.
      ids - Collection ids who are informed in relation to the value.
      value - The value that dictates when the reporter acts.
    • frequencyReporter

      private void frequencyReporter(cs350s22.support.Identifier id, ArrayList<cs350s22.support.Identifier> ids, ArrayList<cs350s22.support.Identifier> groups, int value)
      Creates reporter id that informs the recipients every value updates.
      Parameters:
      id - Name of the reporter object to be created.
      ids - Collection ids who are informed in relation to the value.
      groups - Collection groups who are informed in relation to the value.
      value - The value that dictates when the reporter acts.