private static final int parseTimeString(String str){
  str=str.trim();
  int ret=0;
  boolean neg=false;
  int i=0;
  if (str.charAt(0) == '-') {
    neg=true;
    i++;
  }
  int num=0;
  final int len=str.length();
  for (; i < len; i++) {
    char c=str.charAt(i);
    if ((c >= '0') && (c <= '9')) {
      num=num * 10 + c - '0';
    }
 else     if (c == ':') {
      ret+=num;
      num=0;
      ret*=60;
    }
  }
  ret+=num;
  ret*=1000;
  if (neg)   ret=-ret;
  return ret;
}

private static final int parseTimeString ( String str ) { str = str . trim ( ) ; int ret = 0 ; boolean neg = false ; int i = 0 ; if ( str . charAt ( 0 ) == '-' ) { neg = true ; i ++ ; } int num = 0 ; final int len = str . length ( ) ; for ( ; i < len ; i ++ ) { char c = str . charAt ( i ) ; if ( ( c >= '0' ) && ( c <= '9' ) ) { num = num * 10 + c - '0' ; } else if ( c == ':' ) { ret += num ; num = 0 ; ret *= 60 ; } } ret += num ; ret *= 1000 ; if ( neg ) ret = - ret ; return ret ; }
convert hh : mm : ss to milliseconds
