Package edu.iu.jrsalata
Class ModificationVisitor
java.lang.Object
edu.iu.jrsalata.ModificationVisitor
- All Implemented Interfaces:
VisitorInterface
The ModificationVisitor class implements the VisitorInterface and is used to collect
modification records from ExtendedStatement objects. It maintains a queue to store
the modification information.
This visitor does not perform any actions on other types of statements as no other
type of statements generate modification records
-
Field Summary
Modifier and TypeFieldDescriptionqueue to store modification information -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the queue of modification strings.void
visit
(BaseStatement statement) Visits the given statement.void
visit
(DirectiveStatement statement) Visits the given statement.void
visit
(ExtendedStatement statement) Visits an ExtendedStatement and adds its modification to the list of modifications if the modification is not an empty string.void
visit
(RegisterStatement statement) Visits the given statement.void
visit
(SicStatement statement) Visits the given statement.void
visit
(SingleStatement statement) Visits the given statement.void
Visits the given statement.
-
Field Details
-
modifications
queue to store modification information
-
-
Constructor Details
-
ModificationVisitor
public ModificationVisitor()Constructs a new ModificationVisitor instance. Initializes the modifications list as a LinkedList.
-
-
Method Details
-
visit
Description copied from interface:VisitorInterface
Visits the given statement.- Specified by:
visit
in interfaceVisitorInterface
- Parameters:
statement
- a given statement to visit
-
visit
Description copied from interface:VisitorInterface
Visits the given statement.- Specified by:
visit
in interfaceVisitorInterface
- Parameters:
statement
- a given statement to visit
-
visit
Description copied from interface:VisitorInterface
Visits the given statement.- Specified by:
visit
in interfaceVisitorInterface
- Parameters:
statement
- a given statement to visit
-
visit
Description copied from interface:VisitorInterface
Visits the given statement.- Specified by:
visit
in interfaceVisitorInterface
- Parameters:
statement
- a given statement to visit
-
visit
Visits an ExtendedStatement and adds its modification to the list of modifications if the modification is not an empty string.- Specified by:
visit
in interfaceVisitorInterface
- Parameters:
statement
- the ExtendedStatement to visit
-
visit
Description copied from interface:VisitorInterface
Visits the given statement.- Specified by:
visit
in interfaceVisitorInterface
- Parameters:
statement
- a given statement to visit
-
visit
Description copied from interface:VisitorInterface
Visits the given statement.- Specified by:
visit
in interfaceVisitorInterface
- Parameters:
statement
- a given statement to visit
-
getStrings
Retrieves the queue of modification strings.- Specified by:
getStrings
in interfaceVisitorInterface
- Returns:
- a Queue containing the modification strings.
-