本文整理匯總了Java中net.sourceforge.subsonic.util.Util.subList方法的典型用法代碼示例。如果您正苦於以下問題:Java Util.subList方法的具體用法?Java Util.subList怎麽用?Java Util.subList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.sourceforge.subsonic.util.Util
的用法示例。
在下文中一共展示了Util.subList方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: browsePlaylistRoot
import net.sourceforge.subsonic.util.Util; //導入方法依賴的package包/類
private BrowseResult browsePlaylistRoot(long firstResult, long maxResults) throws Exception {
DIDLContent didl = new DIDLContent();
List<Playlist> allPlaylists = playlistService.getAllPlaylists();
List<Playlist> selectedPlaylists = Util.subList(allPlaylists, firstResult, maxResults);
for (Playlist playlist : selectedPlaylists) {
didl.addContainer(createPlaylistContainer(playlist));
}
return createBrowseResult(didl, selectedPlaylists.size(), allPlaylists.size());
}
示例2: browsePlaylist
import net.sourceforge.subsonic.util.Util; //導入方法依賴的package包/類
private BrowseResult browsePlaylist(Playlist playlist, long firstResult, long maxResults) throws Exception {
List<MediaFile> allChildren = playlistService.getFilesInPlaylist(playlist.getId());
List<MediaFile> selectedChildren = Util.subList(allChildren, firstResult, maxResults);
DIDLContent didl = new DIDLContent();
for (MediaFile child : selectedChildren) {
addContainerOrItem(didl, child);
}
return createBrowseResult(didl, selectedChildren.size(), allChildren.size());
}
示例3: browseRoot
import net.sourceforge.subsonic.util.Util; //導入方法依賴的package包/類
private BrowseResult browseRoot(long firstResult, long maxResults) throws Exception {
DIDLContent didl = new DIDLContent();
List<MusicFolder> allFolders = settingsService.getAllMusicFolders();
List<MusicFolder> selectedFolders = Util.subList(allFolders, firstResult, maxResults);
for (MusicFolder folder : selectedFolders) {
MediaFile mediaFile = mediaFileService.getMediaFile(folder.getPath());
addContainerOrItem(didl, mediaFile);
}
if (maxResults > selectedFolders.size()) {
didl.addContainer(createPlaylistRootContainer());
}
return createBrowseResult(didl, (int) didl.getCount(), allFolders.size() + 1);
}
示例4: browseMediaFile
import net.sourceforge.subsonic.util.Util; //導入方法依賴的package包/類
private BrowseResult browseMediaFile(MediaFile mediaFile, long firstResult, long maxResults) throws Exception {
List<MediaFile> allChildren = mediaFileService.getChildrenOf(mediaFile, true, true, true);
List<MediaFile> selectedChildren = Util.subList(allChildren, firstResult, maxResults);
DIDLContent didl = new DIDLContent();
for (MediaFile child : selectedChildren) {
addContainerOrItem(didl, child);
}
return createBrowseResult(didl, selectedChildren.size(), allChildren.size());
}
示例5: createSubList
import net.sourceforge.subsonic.util.Util; //導入方法依賴的package包/類
public static MediaList createSubList(int index, int count, List<? extends AbstractMedia> mediaCollections) {
MediaList result = new MediaList();
List<? extends AbstractMedia> selectedMediaCollections = Util.subList(mediaCollections, index, count);
result.setIndex(index);
result.setCount(selectedMediaCollections.size());
result.setTotal(mediaCollections.size());
result.getMediaCollectionOrMediaMetadata().addAll(selectedMediaCollections);
return result;
}