private static long sublong(String value,int begin_index,int end_index){
  String substring=value.substring(begin_index,end_index);
  return (substring.length() > 0) ? Long.parseLong(substring) : -1;
}

private static long sublong ( String value , int begin_index , int end_index ) { String substring = value . substring ( begin_index , end_index ) ; return ( substring . length ( ) > 0 ) ? Long . parseLong ( substring ) : - 1 ; }
returns a substring of the given string value from the given begin index to the given end index as a long . if the substring is empty , then - 1 will be returned .
