@Test public void addTwoTest() { media.add("name", "chapter1", "type", 89); assertEquals(1, media.list.size()); }
public Medium add(String mediaLabel, String mediaType, int duration) { int index = searchMediumIndexByMediaLabel(mediaLabel); Medium medium; if (index == -1) { medium = new Medium(player) .setMediaLabel(mediaLabel) .setMediaType(mediaType) .setDuration(duration); list.add(medium); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This medium already exists"); medium = list.get(index); } return medium; }
Media { public Medium add(String mediaLabel, String mediaType, int duration) { int index = searchMediumIndexByMediaLabel(mediaLabel); Medium medium; if (index == -1) { medium = new Medium(player) .setMediaLabel(mediaLabel) .setMediaType(mediaType) .setDuration(duration); list.add(medium); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This medium already exists"); medium = list.get(index); } return medium; } }
Media { public Medium add(String mediaLabel, String mediaType, int duration) { int index = searchMediumIndexByMediaLabel(mediaLabel); Medium medium; if (index == -1) { medium = new Medium(player) .setMediaLabel(mediaLabel) .setMediaType(mediaType) .setDuration(duration); list.add(medium); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This medium already exists"); medium = list.get(index); } return medium; } Media(MediaPlayer player); }
Media { public Medium add(String mediaLabel, String mediaType, int duration) { int index = searchMediumIndexByMediaLabel(mediaLabel); Medium medium; if (index == -1) { medium = new Medium(player) .setMediaLabel(mediaLabel) .setMediaType(mediaType) .setDuration(duration); list.add(medium); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This medium already exists"); medium = list.get(index); } return medium; } Media(MediaPlayer player); Medium add(String mediaLabel, String mediaType, int duration); Medium add(String mediaLabel, String mediaTheme1, String mediaType, int duration); Medium add(String mediaLabel, String mediaTheme1, String mediaTheme2, String mediaType, int duration); Medium add(String mediaLabel, String mediaTheme1, String mediaTheme2, String mediaTheme3, String mediaType, int duration); void remove(String mediaLabel); void removeAll(); }
Media { public Medium add(String mediaLabel, String mediaType, int duration) { int index = searchMediumIndexByMediaLabel(mediaLabel); Medium medium; if (index == -1) { medium = new Medium(player) .setMediaLabel(mediaLabel) .setMediaType(mediaType) .setDuration(duration); list.add(medium); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This medium already exists"); medium = list.get(index); } return medium; } Media(MediaPlayer player); Medium add(String mediaLabel, String mediaType, int duration); Medium add(String mediaLabel, String mediaTheme1, String mediaType, int duration); Medium add(String mediaLabel, String mediaTheme1, String mediaTheme2, String mediaType, int duration); Medium add(String mediaLabel, String mediaTheme1, String mediaTheme2, String mediaTheme3, String mediaType, int duration); void remove(String mediaLabel); void removeAll();  }