コード例 #1
0
 /**
  * Get the relative duration of this event, this will subtract the duration of sub-events. If the
  * event is still active, the duration up till this point in time is returned, else it's the
  * duration from {@link #start()} till {@link #stop()}'
  *
  * @return The relative duration of this event
  */
 public long getDuration() {
   long delta = 0;
   for (PageEvent e : getSubEvents()) {
     delta += e.getDuration();
   }
   return getDurationAbsolute() - delta;
 }
コード例 #2
0
 public List<PageEvent> getSubEventsRecursive() {
   if (mSubEvents.isEmpty()) {
     return mSubEvents;
   }
   ArrayList<PageEvent> tmp = new ArrayList<PageEvent>(mSubEvents);
   for (PageEvent e : mSubEvents) {
     tmp.addAll(e.getSubEventsRecursive());
   }
   return tmp;
 }
コード例 #3
0
 public void reset() {
   mStarted = false;
   mStopped = false;
   mStart = 0;
   mStop = 0;
   for (PageEvent e : mSubEvents) {
     e.reset();
   }
   mSubEvents.clear();
 }