Package org.apache.uima.util.impl
Class ProcessTraceEvent_impl
java.lang.Object
org.apache.uima.util.impl.ProcessTraceEvent_impl
- All Implemented Interfaces:
Serializable,ProcessTraceEvent
Reference implementation of
ProcessTraceEvent.- See Also:
-
Field Summary
Fields inherited from interface org.apache.uima.util.ProcessTraceEvent
ANALYSIS, ANALYSIS_ENGINE, SERVICE, SERVICE_CALL -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ProcessTraceEvent_impl with null property values.ProcessTraceEvent_impl(String aComponentName, String aType, String aDescription) Creates a new ProcessTraceEvent_impl and sets the Component name, type, and description properties. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubEvent(ProcessTraceEvent aEvent) voidaddToDuration(long aAdditionalDuration) Retrieves the name of the component that is performing this event.Retrieves the description of this event.intGets the duration of this event.intGets the duration of this event, minus the sum of the durations of its direct sub-events.Retrieves the result message of this event.longGets the sub-events of this event.getType()Gets the type of event.voidsetComponentName(String aName) voidsetDescription(String aDescription) voidsetDuration(int aDuration) voidsetResultMessage(String aResultMessage) voidsetStartTime(long aStartTime) voidtoString()Generates a user-readable representation of this event and its sub-events.voidtoString(StringBuffer aBuf, int aIndentLevel) Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer.voidtoString(StringBuffer aBuf, int aIndentLevel, int aTotalTime) Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer.protected voidwriteTabs(int aNumTabs, StringBuffer aBuf) Writes tabs to a StringBuffer
-
Constructor Details
-
ProcessTraceEvent_impl
public ProcessTraceEvent_impl()Creates a new ProcessTraceEvent_impl with null property values. -
ProcessTraceEvent_impl
Creates a new ProcessTraceEvent_impl and sets the Component name, type, and description properties.- Parameters:
aComponentName- name of Component generating this eventaType- type of event. Standard event types are defined as constants on theProcessTraceEventinterface, but any string is allowed.aDescription- description of event
-
-
Method Details
-
getComponentName
Description copied from interface:ProcessTraceEventRetrieves the name of the component that is performing this event.- Specified by:
getComponentNamein interfaceProcessTraceEvent- Returns:
- the component name
- See Also:
-
setComponentName
- Parameters:
aName- the component name for this event
-
getType
Description copied from interface:ProcessTraceEventGets the type of event. Standard values for this property are defined as constants on this interface, but any String is allowed.- Specified by:
getTypein interfaceProcessTraceEvent- Returns:
- the event type
- See Also:
-
setType
- Parameters:
aType- the type of this event
-
getDescription
Description copied from interface:ProcessTraceEventRetrieves the description of this event.- Specified by:
getDescriptionin interfaceProcessTraceEvent- Returns:
- the event Description
- See Also:
-
setDescription
- Parameters:
aDescription- the description for this event
-
getDuration
public int getDuration()Description copied from interface:ProcessTraceEventGets the duration of this event.- Specified by:
getDurationin interfaceProcessTraceEvent- Returns:
- the duration of this event, in milliseconds.
- See Also:
-
setDuration
public void setDuration(int aDuration) - Parameters:
aDuration- the duration for this event
-
addToDuration
public void addToDuration(long aAdditionalDuration) - Parameters:
aAdditionalDuration- Adds this to the duration of this event
-
getResultMessage
Description copied from interface:ProcessTraceEventRetrieves the result message of this event.- Specified by:
getResultMessagein interfaceProcessTraceEvent- Returns:
- the event's result message
- See Also:
-
setResultMessage
- Parameters:
aResultMessage- the Result Message for this event
-
getSubEvents
Description copied from interface:ProcessTraceEventGets the sub-events of this event.- Specified by:
getSubEventsin interfaceProcessTraceEvent- Returns:
- a List containing other
ProcessTraceEventobjects - See Also:
-
addSubEvent
- Parameters:
aEvent- Adds this sub-event to this event.
-
toString
Description copied from interface:ProcessTraceEventGenerates a user-readable representation of this event and its sub-events.- Specified by:
toStringin interfaceProcessTraceEvent- Overrides:
toStringin classObject- Returns:
- the String representation of this event and its sub-events
- See Also:
-
toString
Description copied from interface:ProcessTraceEventGenerates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer. This is useful for writing nested events.- Specified by:
toStringin interfaceProcessTraceEvent- Parameters:
aBuf- string buffer to add toaIndentLevel- indentation level- See Also:
-
toString
Description copied from interface:ProcessTraceEventGenerates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer. Also, if the total time for all events is known, this method will print the percentage of time used by this event and its subevents.- Specified by:
toStringin interfaceProcessTraceEvent- Parameters:
aBuf- string buffer to add toaIndentLevel- indentation levelaTotalTime- total time, used to calculate percentags. If not known, pass 0.- See Also:
-
getDurationExcludingSubEvents
public int getDurationExcludingSubEvents()Description copied from interface:ProcessTraceEventGets the duration of this event, minus the sum of the durations of its direct sub-events.- Specified by:
getDurationExcludingSubEventsin interfaceProcessTraceEvent- Returns:
- the duration of this event in milliseconds, excluding the time spent in its sub-events
- See Also:
-
getStartTime
public long getStartTime() -
setStartTime
public void setStartTime(long aStartTime) -
writeTabs
Writes tabs to a StringBuffer- Parameters:
aNumTabs- number of tabs to printaBuf- the buffer to write to
-