@Test public void testSetTime() throws Exception { SRT oldSRT = new SRT(1, SRTTimeFormat.parse("00:00:24,600"), SRTTimeFormat.parse("00:00:26,600"), "Hello World"); SRT newSRT = SRTEditor.setTime(oldSRT, SRTTimeFormat.Type.HOUR, 13); assertEquals(oldSRT.number, newSRT.number); assertEquals("13:00:24,600", SRTTimeFormat.format(newSRT.startTime)); assertEquals("13:00:26,600", SRTTimeFormat.format(newSRT.endTime)); assertEquals(oldSRT.text.get(0), newSRT.text.get(0)); newSRT = SRTEditor.setTime(oldSRT, SRTTimeFormat.Type.MINUTE, 2); assertEquals(oldSRT.number, newSRT.number); assertEquals("00:02:24,600", SRTTimeFormat.format(newSRT.startTime)); assertEquals("00:02:26,600", SRTTimeFormat.format(newSRT.endTime)); assertEquals(oldSRT.text.get(0), newSRT.text.get(0)); newSRT = SRTEditor.setTime(oldSRT, SRTTimeFormat.Type.SECOND, 2); assertEquals(oldSRT.number, newSRT.number); assertEquals("00:00:26,600", SRTTimeFormat.format(newSRT.startTime)); assertEquals("00:00:28,600", SRTTimeFormat.format(newSRT.endTime)); assertEquals(oldSRT.text.get(0), newSRT.text.get(0)); newSRT = SRTEditor.setTime(oldSRT, SRTTimeFormat.Type.MILLISECOND, -200); assertEquals(oldSRT.number, newSRT.number); assertEquals("00:00:24,400", SRTTimeFormat.format(newSRT.startTime)); assertEquals("00:00:26,400", SRTTimeFormat.format(newSRT.endTime)); assertEquals(oldSRT.text.get(0), newSRT.text.get(0)); }
static SRT setTime(SRT srt, SRTTimeFormat.Type type, int value) { return new SRT(srt.number, newDate(srt.startTime, type, value), newDate(srt.endTime, type, value), srt.text); }
SRTEditor { static SRT setTime(SRT srt, SRTTimeFormat.Type type, int value) { return new SRT(srt.number, newDate(srt.startTime, type, value), newDate(srt.endTime, type, value), srt.text); } }
SRTEditor { static SRT setTime(SRT srt, SRTTimeFormat.Type type, int value) { return new SRT(srt.number, newDate(srt.startTime, type, value), newDate(srt.endTime, type, value), srt.text); } private  SRTEditor(); }
SRTEditor { static SRT setTime(SRT srt, SRTTimeFormat.Type type, int value) { return new SRT(srt.number, newDate(srt.startTime, type, value), newDate(srt.endTime, type, value), srt.text); } private  SRTEditor(); static void updateTime(SRTInfo info, int subtitleNumber,
        SRTTimeFormat.Type type, int value); static void updateTimes(SRTInfo info, SRTTimeFormat.Type type, int value); static void updateText(SRTInfo info, int subtitleNumber, int width); static void updateTexts(SRTInfo info, int width); static void appendSubtitle(SRTInfo info, String startTime,
        String endTime, List<String> text); static void prependSubtitle(SRTInfo info, String startTime,
        String endTime, List<String> text); static void insertSubtitle(SRTInfo info, int subtitleNumber,
        String startTime, String endTime, List<String> text); static void insertSubtitle(SRTInfo info, SRT newSRT); static void removeSubtitle(SRTInfo info, int subtitleNumber); static void updateSubtitle(SRTInfo info, SRT srt); }
SRTEditor { static SRT setTime(SRT srt, SRTTimeFormat.Type type, int value) { return new SRT(srt.number, newDate(srt.startTime, type, value), newDate(srt.endTime, type, value), srt.text); } private  SRTEditor(); static void updateTime(SRTInfo info, int subtitleNumber,
        SRTTimeFormat.Type type, int value); static void updateTimes(SRTInfo info, SRTTimeFormat.Type type, int value); static void updateText(SRTInfo info, int subtitleNumber, int width); static void updateTexts(SRTInfo info, int width); static void appendSubtitle(SRTInfo info, String startTime,
        String endTime, List<String> text); static void prependSubtitle(SRTInfo info, String startTime,
        String endTime, List<String> text); static void insertSubtitle(SRTInfo info, int subtitleNumber,
        String startTime, String endTime, List<String> text); static void insertSubtitle(SRTInfo info, SRT newSRT); static void removeSubtitle(SRTInfo info, int subtitleNumber); static void updateSubtitle(SRTInfo info, SRT srt);  }