public class Event extends Object
| Modifier and Type | Field and Description |
|---|---|
static Event |
END_BATCH_EVENT
Deprecated.
Use
createEndBatchEvent() instead of this global object. |
static Event |
NOOP_EVENT
Deprecated.
Use
createNoopEvent() instead of this global object. |
static Event |
START_BATCH_EVENT
Deprecated.
Use
createStartBatchEvent() instead of this global object. |
static Event |
START_BATCH_ITEM_EVENT
Deprecated.
Never used in Okapi, so we will not create a helper method. But using it is dangerous.
|
| Constructor and Description |
|---|
Event() |
Event(EventType filterEventType)
Creates a new event without any associated resource.
|
Event(EventType filterEventType,
IResource resource)
Creates a new event with an associated resource.
|
Event(EventType filterEventType,
IResource resource,
ISkeleton skeleton)
Creates a new event with an associated resource and a skeleton object.
|
| Modifier and Type | Method and Description |
|---|---|
static Event |
createEndBatchEvent()
Convenience method that creates an
EventType.END_BATCH event |
static Event |
createNoopEvent()
Convenience method that creates an
EventType.NO_OP event |
static Event |
createStartBatchEvent()
Convenience method that creates an
EventType.START_BATCH event |
DocumentPart |
getDocumentPart()
Convenience method returns the
IResource as a DocumentPart. |
Ending |
getEndGroup()
|
Ending |
getEnding()
Convenience method returns the Ending resource.
|
EndSubfilter |
getEndSubfilter()
Convenience method returns the
IResource as a EndSubfilter. |
EventType |
getEventType()
Gets the type of this event.
|
MultiEvent |
getMultiEvent()
Convenience method returns the
IResource as a MultiEvent. |
PipelineParameters |
getPipelineParameters()
Convenience method returns the
IResource as a PipelineParameters. |
RawDocument |
getRawDocument()
Convenience method returns the
IResource as a RawDocument. |
IResource |
getResource()
Gets the resource associated to this event.
|
StartDocument |
getStartDocument()
Convenience method returns the
IResource as a StartDocument. |
StartGroup |
getStartGroup()
Convenience method returns the
IResource as a StartGroup. |
StartSubDocument |
getStartSubDocument()
Convenience method returns the
IResource as a StartSubDocument. |
StartSubfilter |
getStartSubfilter()
Convenience method returns the
IResource as a StartSubfilter. |
ITextUnit |
getTextUnit()
|
boolean |
isDocumentPart()
Convenience method to tell if this Event carries a
DocumentPart |
boolean |
isEndDocument()
Convenience method to tell if this Event carries a document
Ending |
boolean |
isEndGroup()
Convenience method to tell if this Event carries a group
Ending |
boolean |
isEndSubDocument()
Convenience method to tell if this Event carries a sub-document
Ending |
boolean |
isEndSubfilter()
Convenience method to tell if this Event is a SubFilter Group
|
boolean |
isMultiEvent()
Convenience method to tell if this Event is a MULTI_EVENT
|
boolean |
isNoop() |
boolean |
isPipelineParametersEvent()
Indicates if this event carries a
PipelineParameters resource. |
boolean |
isRawDocument()
Convenience method to tell if this Event carries a
RawDocument |
boolean |
isStartBatchItem()
Convenience method to tell if this Event is START_BATCH_ITEM
|
boolean |
isStartDocument()
Convenience method to tell if this Event carries a
StartDocument |
boolean |
isStartGroup()
Convenience method to tell if this Event carries a
StartGroup |
boolean |
isStartSubDocument()
Convenience method to tell if this Event carries a
StartSubDocument |
boolean |
isStartSubfilter()
Convenience method to tell if this Event is a SubFilter Group
|
boolean |
isTextUnit()
Convenience method to tell if this Event carries a
ITextUnit |
void |
setEventType(EventType filterEventType) |
void |
setResource(IResource resource)
Sets the resource associated to this event.
|
String |
toString() |
@Deprecated public static final Event END_BATCH_EVENT
createEndBatchEvent() instead of this global object.@Deprecated public static final Event NOOP_EVENT
createNoopEvent() instead of this global object.@Deprecated public static final Event START_BATCH_EVENT
createStartBatchEvent() instead of this global object.@Deprecated public static final Event START_BATCH_ITEM_EVENT
public Event()
public Event(EventType filterEventType)
filterEventType - the type of event to create.public Event(EventType filterEventType, IResource resource)
filterEventType - the type of event to create.resource - the resource to associate to the event.public Event(EventType filterEventType, IResource resource, ISkeleton skeleton)
filterEventType - the type of event to create.resource - the resource to associate to the event.skeleton - the skeleton to associate to the event.public EventType getEventType()
public IResource getResource()
public void setResource(IResource resource)
resource - the new resource.public void setEventType(EventType filterEventType)
public boolean isTextUnit()
ITextUnitITextUnit, false otherwisepublic boolean isDocumentPart()
DocumentPartDocumentPart, false otherwisepublic boolean isStartGroup()
StartGroupStartGroup, false otherwisepublic boolean isEndGroup()
EndingEnding, false otherwisepublic boolean isRawDocument()
RawDocumentRawDocument, false otherwisepublic boolean isStartDocument()
StartDocumentStartDocument, false otherwisepublic boolean isEndDocument()
EndingEnding, false otherwisepublic boolean isStartBatchItem()
public boolean isStartSubDocument()
StartSubDocumentStartSubDocument, false otherwisepublic boolean isEndSubDocument()
EndingEnding, false otherwisepublic boolean isMultiEvent()
MultiEvent, false otherwisepublic boolean isStartSubfilter()
StartSubfilter, false otherwisepublic boolean isEndSubfilter()
StartSubfilter, false otherwisepublic ITextUnit getTextUnit()
IResource as a ITextUnit.
The caller should confirm the Event type using isTextUnit before
calling this method.ITextUnitOkapiUnexpectedResourceTypeException - if the IResource is not a ITextUnitpublic DocumentPart getDocumentPart()
IResource as a DocumentPart.
The caller should confirm the Event type using isDocumentPart before calling
this method.DocumentPartOkapiUnexpectedResourceTypeException - if the IResource is not a DocumentPartpublic StartGroup getStartGroup()
IResource as a StartGroup. The
caller should confirm the Event type using isStartGroup before calling this
method.StartGroupOkapiUnexpectedResourceTypeException - if the IResource is not a StartGrouppublic Ending getEndGroup()
IResource as a Ending. The caller
should confirm the Event type using isEndGroup before calling this method.EndingOkapiUnexpectedResourceTypeException - if the IResource is not a Endingpublic Ending getEnding()
public RawDocument getRawDocument()
IResource as a RawDocument. The
caller should confirm the Event type using isRawDocument before calling
this method.RawDocumentOkapiUnexpectedResourceTypeException - if the IResource is not a RawDocumentpublic StartSubDocument getStartSubDocument()
IResource as a StartSubDocument. The
caller should confirm the Event type using isStartSubDocument before calling
this method.StartSubDocumentOkapiUnexpectedResourceTypeException - if the IResource is not a StartSubDocumentpublic StartDocument getStartDocument()
IResource as a StartDocument. The
caller should confirm the Event type using isStartDocument before calling
this method.StartDocumentOkapiUnexpectedResourceTypeException - if the IResource is not a StartDocumentpublic StartSubfilter getStartSubfilter()
IResource as a StartSubfilter. The
caller should confirm the Event type using isStartSubfilter before calling
this method.StartSubfilterOkapiUnexpectedResourceTypeException - if the IResource is not a StartSubfilterpublic EndSubfilter getEndSubfilter()
IResource as a EndSubfilter. The
caller should confirm the Event type using isEndSubfilter before calling
this method.EndSubfilterOkapiUnexpectedResourceTypeException - if the IResource is not a EndSubfilterpublic MultiEvent getMultiEvent()
IResource as a MultiEvent. The
caller should confirm the EventType using isMultiEvent before calling
this method.MultiEventOkapiUnexpectedResourceTypeException - if the IResource is not a MultiEventpublic boolean isPipelineParametersEvent()
PipelineParameters resource.PipelineParameters resource, false otherwise.public PipelineParameters getPipelineParameters()
IResource as a PipelineParameters.PipelineParametersOkapiUnexpectedResourceTypeException - if the IResource is not a PipelineParameterspublic boolean isNoop()
public static final Event createEndBatchEvent()
EventType.END_BATCH eventpublic static final Event createNoopEvent()
EventType.NO_OP eventpublic static final Event createStartBatchEvent()
EventType.START_BATCH eventCopyright © 2022. All rights reserved.