|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.atunes.kernel.handlers.RepositoryHandler
public class RepositoryHandler
The Class RepositoryHandler.
Nested Class Summary | |
---|---|
static class |
RepositoryHandler.SortType
The Enum SortType. |
Method Summary | |
---|---|
void |
addAndRefresh(java.util.List<java.io.File> files,
java.io.File folder)
Adds the and refresh. |
void |
addExternalPictureForAlbum(java.lang.String artistName,
java.lang.String albumName,
java.io.File picture)
Adds the external picture for album. |
void |
applicationFinish()
Finish. |
java.lang.Runnable |
getAfterStartActionsRunnable()
Returns a runnable object to be executed after application start |
java.util.Map<java.lang.String,java.lang.Integer> |
getAlbumMostPlayed()
Gets the album most played. |
java.util.List<Album> |
getAlbums()
Gets the albums. |
java.lang.Integer |
getAlbumTimesPlayed(AudioFile song)
Gets the album times played. |
java.util.Map<java.lang.String,Artist> |
getArtistAndAlbumStructure()
Gets the artist and album structure. |
java.util.Map<java.lang.String,java.lang.Integer> |
getArtistMostPlayed()
Gets the artist most played. |
java.util.List<Artist> |
getArtists()
Gets the artists. |
java.lang.Integer |
getArtistTimesPlayed(AudioFile song)
Gets the artist times played. |
int |
getDifferentSongsPlayed()
Gets the different songs played. |
AudioFile |
getFileIfLoaded(java.lang.String fileName)
Gets the file if loaded. |
java.util.Map<java.lang.String,Folder> |
getFolderStructure()
Gets the folder structure. |
java.util.Map<java.lang.String,Genre> |
getGenreStructure()
Gets the genre structure. |
static RepositoryHandler |
getInstance()
Gets the single instance of RepositoryHandler. |
java.util.List<Album> |
getMostPlayedAlbums(int n)
Gets the most played albums. |
java.util.List<java.lang.Object[]> |
getMostPlayedAlbumsInRanking(int n)
Gets the most played albums in ranking. |
java.util.List<Artist> |
getMostPlayedArtists(int n)
Gets the most played artists. |
java.util.List<java.lang.Object[]> |
getMostPlayedArtistsInRanking(int n)
Gets the most played artists in ranking. |
java.util.List<AudioFile> |
getMostPlayedSongs(int n)
Gets the most played songs. |
java.util.List<java.lang.Object[]> |
getMostPlayedSongsInRanking(int n)
Gets the most played songs in ranking. |
java.lang.String |
getPathForNewSongsRipped()
Gets the path for new songs ripped. |
java.lang.Runnable |
getReadRepositoryFromCacheRunnable()
Process to read repository from cache. |
Repository |
getRepository()
Gets the repository. |
java.io.File |
getRepositoryFolderContainingFile(AudioFile file)
Returns repository root folder that contains file. |
java.lang.String |
getRepositoryPath()
Gets the repository path. |
long |
getRepositoryTotalSize()
Gets the repository total size. |
java.util.Map<AudioFile,java.lang.Integer> |
getSongMostPlayed()
Gets the song most played. |
java.util.List<AudioFile> |
getSongs()
Gets the songs. |
java.util.List<AudioFile> |
getSongsForAlbums(java.util.Map<java.lang.String,Album> albums)
Gets the songs for albums. |
java.util.List<AudioFile> |
getSongsForArtists(java.util.Map<java.lang.String,Artist> artists)
Gets the songs for artists. |
java.lang.String |
getSongsPlayed()
Gets the songs played. |
SongStats |
getSongStatistics(AudioFile song)
Gets the song statistics. |
int |
getTotalSongsPlayed()
Gets the total songs played. |
java.util.List<AudioFile> |
getUnplayedSongs()
Gets the unplayed songs. |
boolean |
isRepository(java.io.File folder)
Returns true if folder is in repository. |
void |
notifyCancel()
Notify cancel. |
void |
notifyCurrentPath(java.lang.String dir)
Notify current path. |
void |
notifyFileLoaded()
Notify file loaded. |
void |
notifyFilesInRepository(int totalFiles)
Notify files in repository. |
void |
notifyFinishRead(RepositoryLoader loader)
Notify finish read. |
void |
notifyFinishRefresh(RepositoryLoader loader)
Notify finish refresh. |
void |
notifyRemainingTime(long millis)
Notify remaining time. |
void |
refreshFile(AudioFile file)
Refresh file. |
void |
refreshRepository()
Refresh repository. |
void |
removePhysically(java.util.List<AudioFile> filesToRemove)
Removes a list of files permanently from disk. |
boolean |
repositoryIsNull()
Repository is null. |
boolean |
retrieve(java.util.List<java.io.File> folders)
Retrieve. |
boolean |
selectRepository()
Select repository. |
boolean |
selectRepository(boolean repositoryNotFound)
Select repository. |
void |
setRepository()
Sets the repository. |
void |
setSongStatistics(AudioFile song)
Sets the song statistics. |
java.util.List<AudioObject> |
sort(java.util.List<? extends AudioObject> songs)
Sort. |
java.util.List<AudioObject> |
sort(java.util.List<? extends AudioObject> songs,
RepositoryHandler.SortType type)
Sort. |
void |
transferStatsFrom(Repository newRepository,
Repository oldRepository)
Gets stats from a repository. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static RepositoryHandler getInstance()
public java.lang.Runnable getAfterStartActionsRunnable()
public void addAndRefresh(java.util.List<java.io.File> files, java.io.File folder)
files
- the filesfolder
- the folderpublic void addExternalPictureForAlbum(java.lang.String artistName, java.lang.String albumName, java.io.File picture)
artistName
- the artist namealbumName
- the album namepicture
- the picturepublic void applicationFinish()
applicationFinish
in interface ApplicationFinishListener
public java.util.Map<java.lang.String,java.lang.Integer> getAlbumMostPlayed()
public java.util.List<Album> getAlbums()
public java.lang.Integer getAlbumTimesPlayed(AudioFile song)
song
- the song
public java.util.Map<java.lang.String,Artist> getArtistAndAlbumStructure()
public java.util.Map<java.lang.String,java.lang.Integer> getArtistMostPlayed()
public java.util.List<Artist> getArtists()
public java.lang.Integer getArtistTimesPlayed(AudioFile song)
song
- the song
public int getDifferentSongsPlayed()
public AudioFile getFileIfLoaded(java.lang.String fileName)
fileName
- the file name
public java.util.Map<java.lang.String,Folder> getFolderStructure()
public java.util.Map<java.lang.String,Genre> getGenreStructure()
public java.util.List<Album> getMostPlayedAlbums(int n)
n
- the n
public java.util.List<java.lang.Object[]> getMostPlayedAlbumsInRanking(int n)
n
- the n
public java.util.List<Artist> getMostPlayedArtists(int n)
n
- the n
public java.util.List<java.lang.Object[]> getMostPlayedArtistsInRanking(int n)
n
- the n
public java.util.List<AudioFile> getMostPlayedSongs(int n)
n
- the n
public java.util.List<java.lang.Object[]> getMostPlayedSongsInRanking(int n)
n
- the n
public java.lang.String getPathForNewSongsRipped()
public Repository getRepository()
public java.io.File getRepositoryFolderContainingFile(AudioFile file)
file
- the file
public java.lang.String getRepositoryPath()
public long getRepositoryTotalSize()
public java.util.Map<AudioFile,java.lang.Integer> getSongMostPlayed()
public java.util.List<AudioFile> getSongs()
public java.util.List<AudioFile> getSongsForAlbums(java.util.Map<java.lang.String,Album> albums)
albums
- the albums
public java.util.List<AudioFile> getSongsForArtists(java.util.Map<java.lang.String,Artist> artists)
artists
- the artists
public java.lang.String getSongsPlayed()
public SongStats getSongStatistics(AudioFile song)
song
- the song
public int getTotalSongsPlayed()
public java.util.List<AudioFile> getUnplayedSongs()
public boolean isRepository(java.io.File folder)
folder
- the folder
public void notifyCancel()
public void notifyCurrentPath(java.lang.String dir)
LoaderListener
notifyCurrentPath
in interface LoaderListener
dir
- the pathpublic void notifyFileLoaded()
LoaderListener
notifyFileLoaded
in interface LoaderListener
public void notifyFilesInRepository(int totalFiles)
LoaderListener
notifyFilesInRepository
in interface LoaderListener
totalFiles
- the filespublic void notifyFinishRead(RepositoryLoader loader)
LoaderListener
notifyFinishRead
in interface LoaderListener
loader
- the loaderpublic void notifyFinishRefresh(RepositoryLoader loader)
LoaderListener
notifyFinishRefresh
in interface LoaderListener
loader
- the loaderpublic void notifyRemainingTime(long millis)
LoaderListener
notifyRemainingTime
in interface LoaderListener
millis
- the timepublic java.lang.Runnable getReadRepositoryFromCacheRunnable()
public void setRepository()
public void refreshFile(AudioFile file)
file
- the filepublic void refreshRepository()
public void removePhysically(java.util.List<AudioFile> filesToRemove)
filesToRemove
- Files that should be removedpublic boolean repositoryIsNull()
public boolean retrieve(java.util.List<java.io.File> folders)
folders
- the folders
public boolean selectRepository()
public boolean selectRepository(boolean repositoryNotFound)
repositoryNotFound
- the repository not found
public void setSongStatistics(AudioFile song)
song
- the new song statisticspublic java.util.List<AudioObject> sort(java.util.List<? extends AudioObject> songs)
songs
- the songs
public java.util.List<AudioObject> sort(java.util.List<? extends AudioObject> songs, RepositoryHandler.SortType type)
songs
- the songstype
- the type
public void transferStatsFrom(Repository newRepository, Repository oldRepository)
oldRepository
- the old repositorynewRepository
- the new repository
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |