@Test public void testUpdateTexts() throws Exception { SRTInfo srtInfo = new SRTInfo(); srtInfo.add(new SRT(1, SRTTimeFormat.parse("00:00:24,600"), SRTTimeFormat.parse("00:00:26,600"), "Hello!!! This is a very long string.", "Ain't it cool??? :)")); srtInfo.add(new SRT(2, SRTTimeFormat.parse("00:11:24,600"), SRTTimeFormat.parse("00:12:26,600"), "Hello!!! There is really nothing to see here.", "Foo Bar.", "Bye World.")); SRTEditor.updateTexts(srtInfo, 15); SRT srt = srtInfo.get(1); assertEquals(1L, srt.number); assertEquals("00:00:24,600", SRTTimeFormat.format(srt.startTime)); assertEquals("00:00:26,600", SRTTimeFormat.format(srt.endTime)); assertEquals(4, srt.text.size()); assertEquals("Hello!!! This", srt.text.get(0)); assertEquals("is a very long", srt.text.get(1)); assertEquals("string. Ain't", srt.text.get(2)); assertEquals("it cool??? :)", srt.text.get(3)); srt = srtInfo.get(2); assertEquals(2L, srt.number); assertEquals("00:11:24,600", SRTTimeFormat.format(srt.startTime)); assertEquals("00:12:26,600", SRTTimeFormat.format(srt.endTime)); assertEquals(5, srt.text.size()); assertEquals("Hello!!! There", srt.text.get(0)); assertEquals("is really", srt.text.get(1)); assertEquals("nothing to see", srt.text.get(2)); assertEquals("here. Foo Bar.", srt.text.get(3)); assertEquals("Bye World.", srt.text.get(4)); }
public static void updateTexts(SRTInfo info, int width) { for (int i = 1; i <= info.size(); i++) { updateText(info, info.get(i).number, width); } }
SRTEditor { public static void updateTexts(SRTInfo info, int width) { for (int i = 1; i <= info.size(); i++) { updateText(info, info.get(i).number, width); } } }
SRTEditor { public static void updateTexts(SRTInfo info, int width) { for (int i = 1; i <= info.size(); i++) { updateText(info, info.get(i).number, width); } } private  SRTEditor(); }
SRTEditor { public static void updateTexts(SRTInfo info, int width) { for (int i = 1; i <= info.size(); i++) { updateText(info, info.get(i).number, width); } } 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 { public static void updateTexts(SRTInfo info, int width) { for (int i = 1; i <= info.size(); i++) { updateText(info, info.get(i).number, width); } } 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);  }