Package cs350s22.component.ui.parser
Class ReporterParser
java.lang.Object
cs350s22.component.ui.parser.ReporterParser
- All Implemented Interfaces:
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
Modifier and TypeFieldDescriptionprivate final String[]
private final int
private final cs350s22.component.ui.parser.A_ParserHelper
-
Constructor Summary
ConstructorDescriptionReporterParser
(String[] args, cs350s22.component.ui.parser.A_ParserHelper parserHelper) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate 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
parse()
Method each sub parser is required to use to begin parsing their respective commands.
-
Field Details
-
args
-
parserHelper
private final cs350s22.component.ui.parser.A_ParserHelper parserHelper -
numOfCmdArgs
private final int numOfCmdArgs
-
-
Constructor Details
-
ReporterParser
Constructor.
-
-
Method Details
-
parse
Description copied from interface:SubParser
Method each sub parser is required to use to begin parsing their respective commands.- Specified by:
parse
in interfaceSubParser
- 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.
-