Package com.jitcaforwin.extended.api.collections

Examples of com.jitcaforwin.extended.api.collections.GenreCollection


*
*/
public final class PlaylistUtilities {

  public static GenreCollection getAllGenres(Playlist playlist) {
    GenreCollection genres = new GenreCollectionImpl();

    for (Track track : playlist.getTracks()) {
      if (!genres.contains(track.getGenre())) {
        genres.add(track.getGenre());
      }
    }
    return genres;
  }
View Full Code Here


    }
    return genres;
  }
 
  public static GenreCollection getId3Genres(Playlist playlist){
    GenreCollection genres = new GenreCollectionImpl();

    for (Track track : playlist.getTracks()) {
      if (track.getGenre().isId3TagGenre() && !genres.contains(track.getGenre())) {
        genres.add(track.getGenre());
      }
    }
    return genres;
  }
View Full Code Here

    }
    return genres;
  }

  public static GenreCollection getNonId3Genres(Playlist playlist) {
    GenreCollection genres = new GenreCollectionImpl();

    for (Track track : playlist.getTracks()) {
      if (!track.getGenre().isId3TagGenre() && !genres.contains(track.getGenre())) {
        genres.add(track.getGenre());
      }
    }
    return genres;
  }
View Full Code Here

    }
    return genres;
  }
 
  public static GenreCollection getNonId3BasicGenres(Playlist playlist){
    GenreCollection genres = new GenreCollectionImpl();

    for (Track track : playlist.getTracks()) {
      if (!track.getGenre().isBasicId3TagGenre() && !genres.contains(track.getGenre())) {
        genres.add(track.getGenre());
      }
    }
    return genres;
  }
View Full Code Here

    EasyMock.expect(trackMock2.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock3.getGenre()).andReturn(genreMockB).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
    GenreCollection actualGenres = PlaylistUtilities.getAllGenres(playlistMock);
   
    assertTrue(actualGenres.contains(genreMockA));
    assertTrue(actualGenres.contains(genreMockB));
    assertEquals(2, actualGenres.size());
   
    EasyMock.verify(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
  }
View Full Code Here

    EasyMock.expect(genreMockA.isId3TagGenre()).andReturn(true).anyTimes();
    EasyMock.expect(genreMockB.isId3TagGenre()).andReturn(false).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
    GenreCollection actualGenres = PlaylistUtilities.getNonId3Genres(playlistMock);
   
    assertTrue(actualGenres.contains(genreMockB));
    assertEquals(1, actualGenres.size());
   
    EasyMock.verify(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
  }
View Full Code Here

    EasyMock.expect(genreMockA.isId3TagGenre()).andReturn(true).anyTimes();
    EasyMock.expect(genreMockB.isId3TagGenre()).andReturn(false).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
    GenreCollection actualGenres = PlaylistUtilities.getId3Genres(playlistMock);
   
    assertTrue(actualGenres.contains(genreMockA));
    assertEquals(1, actualGenres.size());
   
    EasyMock.verify(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
  }
View Full Code Here

    EasyMock.expect(genreMockA.isBasicId3TagGenre()).andReturn(true).anyTimes();
    EasyMock.expect(genreMockB.isBasicId3TagGenre()).andReturn(false).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
    GenreCollection actualGenres = PlaylistUtilities.getNonId3BasicGenres(playlistMock);
   
    assertTrue(actualGenres.contains(genreMockB));
    assertEquals(1, actualGenres.size());
   
    EasyMock.verify(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
  }
View Full Code Here

    return this.getPlaylist().getTracks().analyzeTrackInfo();
  }

  @Override
  public GenreCollection getAllGenres() {
    GenreCollection genres = new GenreCollectionImpl();
   
    for(Track track : this.getPlaylist().getTracks()){
      if (!genres.contains(track.getGenre())){
        genres.add(track.getGenre());
      }
    }
   
    return genres;
  }
View Full Code Here

public class GenreCollectionTest {

  @Test
  public void testLazy() {
    GenreCollection collection = new GenreCollectionImpl();
    assertTrue(collection.isLazy());
  }
View Full Code Here

TOP

Related Classes of com.jitcaforwin.extended.api.collections.GenreCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.