@Test public void testParse3() { String input = " 10h49m789 , 12h "; long expected1 = 10 * 3600000 + 49 * 60000 + 789; long expected2 = 12 * 3600000; long[] result = TimeIntervalParser.parse( input ); assertEquals( 2, result.length ); assertEquals( expected1, result[0] ); assertEquals( expected2, result[1] ); }
public static long[] parse(String paramText) { if ( paramText == null || paramText.trim().length() == 0 ) { return new long[0]; } String[] params = paramText.split( "," ); long[] result = new long[params.length]; for ( int i = 0; i < params.length; i++ ) { result[i] = parseSingle( params[i] ); } return result; }
TimeIntervalParser { public static long[] parse(String paramText) { if ( paramText == null || paramText.trim().length() == 0 ) { return new long[0]; } String[] params = paramText.split( "," ); long[] result = new long[params.length]; for ( int i = 0; i < params.length; i++ ) { result[i] = parseSingle( params[i] ); } return result; } }
TimeIntervalParser { public static long[] parse(String paramText) { if ( paramText == null || paramText.trim().length() == 0 ) { return new long[0]; } String[] params = paramText.split( "," ); long[] result = new long[params.length]; for ( int i = 0; i < params.length; i++ ) { result[i] = parseSingle( params[i] ); } return result; } private  TimeIntervalParser(); }
TimeIntervalParser { public static long[] parse(String paramText) { if ( paramText == null || paramText.trim().length() == 0 ) { return new long[0]; } String[] params = paramText.split( "," ); long[] result = new long[params.length]; for ( int i = 0; i < params.length; i++ ) { result[i] = parseSingle( params[i] ); } return result; } private  TimeIntervalParser(); static long[] parse(String paramText); static long parseSingle(String param); }
TimeIntervalParser { public static long[] parse(String paramText) { if ( paramText == null || paramText.trim().length() == 0 ) { return new long[0]; } String[] params = paramText.split( "," ); long[] result = new long[params.length]; for ( int i = 0; i < params.length; i++ ) { result[i] = parseSingle( params[i] ); } return result; } private  TimeIntervalParser(); static long[] parse(String paramText); static long parseSingle(String param);  }