Package app
Interface MediaStorage
- All Known Implementing Classes:
SQLiteStorage
public interface MediaStorage
Implementors of this interface can be used as a Media storage back-end by
MediaCommunicator.
The methods in this interface permit throwing exceptions to accomodate implementations backed by something fallible, such as the filesystem. The possible sources of error (if any) depend on the specific implementation.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteMedia
(long id) Delete the Media with the given ID.getIDsWithin
(double x, double y, double w, double h) boolean
isIDtaken
(long id) loadMedia
(long id) Load the Media with the given name.void
Save the given Media.
-
Method Details
-
deleteMedia
Delete the Media with the given ID.- Throws:
Exception
-
saveMedia
Save the given Media.The Media must be assigned an ID other than `Media.EMPTY_ID`.
- Throws:
Exception
-
loadMedia
Load the Media with the given name.- Parameters:
id
- The unique identifier of the Media to load- Returns:
- The Media object with the given ID, or `null` if no such Media object is stored.
- Throws:
Exception
-
getIDsWithin
- Returns:
- The IDs of the Media objects within the rectangular region with width `w`, height `h`, and top-left corner at (`x`, `y`).
- Throws:
Exception
-
isIDtaken
- Returns:
- Whether or not Media with the given identifier is stored.
- Throws:
Exception
-