Class ITLibraryDescriptor
- java.lang.Object
-
- com.tagtraum.beatunes.library.LibraryDescriptor
-
- com.tagtraum.beatunes.library.itunes.ITLibraryDescriptor
-
public class ITLibraryDescriptor extends LibraryDescriptor
Descriptor for anITLibrary
-based iTunes/Music.app library.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description ITLibraryDescriptor(long id)
ITLibraryDescriptor(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LibraryLoader
createLibraryLoader()
Creates a library loader appropriate for this kind of library.boolean
equals(Object o)
boolean
exists()
Indicates whether the library described by this instance actually exists.String
getIdAsString()
Library id asString
.long
getLastModified()
If this library descriptor describes a document or is capable of determining the last modification of the library as a whole, this method returns the date.String
getName()
Name.int
hashCode()
boolean
needsRefresh(long lastSync)
Indicates whether we might want to sync this library.String
toString()
AudioSong
wrap(AudioSong audioSong)
Wraps an internal database song into anotherAudioSong
that is capable of writing/reading data to external databases or files (e.g.PlayList
wrap(PlayList playList)
Wraps an internal database playlist into anotherPlayList
that is capable of writing/reading data to external databases or files.-
Methods inherited from class com.tagtraum.beatunes.library.LibraryDescriptor
getId, getMediaLibrary, setMediaLibrary
-
-
-
-
Constructor Detail
-
ITLibraryDescriptor
public ITLibraryDescriptor(String id)
-
ITLibraryDescriptor
public ITLibraryDescriptor(long id)
-
-
Method Detail
-
getLastModified
public long getLastModified() throws IOException
Description copied from class:LibraryDescriptor
If this library descriptor describes a document or is capable of determining the last modification of the library as a whole, this method returns the date.- Specified by:
getLastModified
in classLibraryDescriptor
- Returns:
- date of last modification or 0 if unknown
- Throws:
IOException
-
needsRefresh
public boolean needsRefresh(long lastSync) throws IOException
Description copied from class:LibraryDescriptor
Indicates whether we might want to sync this library. If this cannot determined accurately, this method returnstrue
.- Specified by:
needsRefresh
in classLibraryDescriptor
- Parameters:
lastSync
- date of last sync- Returns:
- true, if we should probably sync
- Throws:
IOException
-
getIdAsString
public String getIdAsString()
Description copied from class:LibraryDescriptor
Library id asString
.- Specified by:
getIdAsString
in classLibraryDescriptor
- Returns:
- id
- See Also:
PersistentId.idStringToLong(String)
-
getName
public String getName()
Description copied from class:LibraryDescriptor
Name. E.g. "iTunes".- Specified by:
getName
in classLibraryDescriptor
- Returns:
- library name
-
exists
public boolean exists()
Description copied from class:LibraryDescriptor
Indicates whether the library described by this instance actually exists. Defaults totrue
.- Overrides:
exists
in classLibraryDescriptor
- Returns:
- true or false
-
createLibraryLoader
public LibraryLoader createLibraryLoader()
Description copied from class:LibraryDescriptor
Creates a library loader appropriate for this kind of library.- Specified by:
createLibraryLoader
in classLibraryDescriptor
- Returns:
- library loader
-
wrap
public AudioSong wrap(AudioSong audioSong)
Description copied from class:LibraryDescriptor
Wraps an internal database song into anotherAudioSong
that is capable of writing/reading data to external databases or files (e.g.Track
orAudioMetaData
). Depending on the kind of library, this wrapper might be quite different.- Specified by:
wrap
in classLibraryDescriptor
- Parameters:
audioSong
- song object to be wrapped, e.g.Song
- Returns:
- wrapper
-
wrap
public PlayList wrap(PlayList playList)
Description copied from class:LibraryDescriptor
Wraps an internal database playlist into anotherPlayList
that is capable of writing/reading data to external databases or files. Depending on the kind of library, this wrapper might be quite different.- Specified by:
wrap
in classLibraryDescriptor
- Parameters:
playList
- song object to be wrapped, e.g.HibernatePlayList
- Returns:
- wrapper
-
-