public void addChildTime(MethodGroup child,long time){
  int index=-1;
  for (int i=0; i < childCount; i++) {
    if (children[i] == child) {
      index=i;
      break;
    }
  }
  if (index == -1) {
    if (childCount == children.length) {
      int newChildCount=childCount + (childCount >> 1);
      MethodGroup[] oldChildren=children;
      children=new MethodGroup[newChildCount];
      System.arraycopy(oldChildren,0,children,0,childCount);
      long[] oldChildrenTimes=childrenTimes;
      childrenTimes=new long[newChildCount];
      System.arraycopy(oldChildrenTimes,0,childrenTimes,0,childCount);
    }
    children[childCount]=child;
    index=childCount++;
  }
  childrenTimes[index]+=time;
}

public void addChildTime ( MethodGroup child , long time ) { int index = - 1 ; for ( int i = 0 ; i < childCount ; i ++ ) { if ( children [ i ] == child ) { index = i ; break ; } } if ( index == - 1 ) { if ( childCount == children . length ) { int newChildCount = childCount + ( childCount > > 1 ) ; MethodGroup [ ] oldChildren = children ; children = new MethodGroup [ newChildCount ] ; System . arraycopy ( oldChildren , 0 , children , 0 , childCount ) ; long [ ] oldChildrenTimes = childrenTimes ; childrenTimes = new long [ newChildCount ] ; System . arraycopy ( oldChildrenTimes , 0 , childrenTimes , 0 , childCount ) ; } children [ childCount ] = child ; index = childCount ++ ; } childrenTimes [ index ] += time ; }
updates this method ' s info with the time spent in a given child .
