/** * Returns the total duration of a given event. * * @param aPT - * Event container * @param eventName - * name of the event for which the time is needed * @return - total duration of an event */ public synchronized static long extractTime(ProcessTrace aPT, String eventName) { List aList = aPT.getEvents(); int counter = 0; while (aList != null && aList.size() > 0 && counter < aList.size()) { ProcessTraceEvent pte = (ProcessTraceEvent) aList.get(counter++); if (pte == null) { return 0; } else if (eventName == null || eventName.equals(pte.getDescription())) { return pte.getDurationExcludingSubEvents(); } else { List subEvents = pte.getSubEvents(); for (int i = 0; subEvents != null && i < subEvents.size(); i++) { if (eventName.equals(((ProcessTraceEvent) subEvents.get(i)).getType())) { return ((ProcessTraceEvent) subEvents.get(i)).getDurationExcludingSubEvents(); } } } } return 0; }
Level.FINEST, tabS + "COMPONENT : " + compNameS + "\tTYPE : " + typeS + "\tDescription : " + prEvent.getDescription()); UIMAFramework.getLogger(Checkpoint.class).log(Level.FINEST, tabS + "TOTAL_TIME : " + totDur + "\tTIME_EXCLUDING_SUBEVENTS : " + dur);