public class CommentEventsCollector extends Object
| Constructor and Description |
|---|
CommentEventsCollector(Parser parser,
CommentType... expectedCommentTypes)
Constructor used to collect comment events emitted by a Parser.
|
CommentEventsCollector(Queue<Event> eventSource,
CommentType... expectedCommentTypes)
Constructor used to collect events emitted by the Serializer.
|
| Modifier and Type | Method and Description |
|---|---|
CommentEventsCollector |
collectEvents()
Collect all events of the expected type (set during construction) starting with the top event
on the event source.
|
Event |
collectEvents(Event event)
Collect all events of the expected type (set during construction) starting with event provided
as an argument and continuing with the top event on the event source.
|
Event |
collectEventsAndPoll(Event event)
Collect all events of the expected type (set during construction) starting with event provided
as an argument and continuing with the top event on the event source.
|
List<CommentLine> |
consume()
Return the events collected and reset the colletor.
|
boolean |
isEmpty()
Test if the collector contains any collected events.
|
public CommentEventsCollector(Parser parser, CommentType... expectedCommentTypes)
parser - the event source.expectedCommentTypes - the comment types expected. Any comment types not included are not
collected.public CommentEventsCollector(Queue<Event> eventSource, CommentType... expectedCommentTypes)
eventSource - the event source.expectedCommentTypes - the comment types expected. Any comment types not included are not
collected.public CommentEventsCollector collectEvents()
public Event collectEvents(Event event)
event - the first event to attempt to collect.nullpublic Event collectEventsAndPoll(Event event)
event - the first event to attempt to collect.public List<CommentLine> consume()
public boolean isEmpty()
true if it does; Otherwise, falseCopyright © 2008–2022. All rights reserved.