diff options
author | Matt Windsor <mbw500@student.cs.york.ac.uk> | 2011-03-07 13:50:24 +0000 |
---|---|---|
committer | Matt Windsor <mbw500@student.cs.york.ac.uk> | 2011-03-07 13:50:24 +0000 |
commit | 9b4647f1ae8c3f41163d0d4053504dab861d0c94 (patch) | |
tree | b621e8c0b75a5cadd69f938116b1637f7ad0c94d /src/uk/org/ury/library/LibraryItem.java | |
parent | c33f098de8a43a2df778d4d694e0c07bbde59828 (diff) |
Emergency impending hard drive failure dump - lots of changes on the frontend, but they're all potentially controversial so I'm not pushing to master yet. Beginnings of show viewer. Application now run through demo menu, which allows for the links between modules to be tested.
Diffstat (limited to 'src/uk/org/ury/library/LibraryItem.java')
-rw-r--r-- | src/uk/org/ury/library/LibraryItem.java | 84 |
1 files changed, 9 insertions, 75 deletions
diff --git a/src/uk/org/ury/library/LibraryItem.java b/src/uk/org/ury/library/LibraryItem.java index 881f840..6156bab 100644 --- a/src/uk/org/ury/library/LibraryItem.java +++ b/src/uk/org/ury/library/LibraryItem.java @@ -6,6 +6,9 @@ package uk.org.ury.library; import java.util.Map; +import uk.org.ury.database.DatabaseItem; +import uk.org.ury.library.LibraryItemProperty; + /** * An item in the URY library. @@ -13,81 +16,12 @@ import java.util.Map; * @author Matt Windsor */ -public class LibraryItem +public class LibraryItem extends DatabaseItem<LibraryItemProperty, + String> { - /** - * The parameters that are stored in the LibraryItem. - * - * @author Matt Windsor - */ - - public enum LibraryProperty - { - // Constant SQL identifier - TITLE ("title"), - ALBUM ("album"), - ARTIST ("artist"), - LABEL ("label"), - STATUS ("status"), - MEDIUM ("medium"), - FORMAT ("format"), - DATE_RELEASED ("datereleased"), - DATE_ADDED ("dateadded"), - DATE_EDITED ("dateedited"), - SHELF_LETTER ("shelfletter"), - SHELF_NUMBER ("shelfnumber"), - CD_ID ("cdid"), - ADD_MEMBER_ID ("memberid_add"), - EDIT_MEMBER_ID ("memberid_lastedit"), - ADD_FORENAME ("fnameadd"), - ADD_SURNAME ("snameadd"), - EDIT_FORENAME ("fnameedit"), - EDIT_SURNAME ("snameedit"), - IS_DIGITISED ("digitised"), - IS_CLEAN ("clean"); - - - public final String sql; - - private - LibraryProperty (String sql) - { - this.sql = sql; - } - }; - - - private Map<LibraryProperty, String> properties; - - - /** - * Construct a new library item from an existing list of - * properties. - * - * @param properties The map of properties that the new item will - * inherit. - */ - public - LibraryItem (Map<LibraryProperty, String> properties) - { - this.properties = properties; - } - - - /** - * Query this item for a property. - * - * @param property The property to query. - * @return The property, if it exists, or "Unknown" otherwise. - */ - - public String - get (LibraryProperty property) + LibraryItem (Map<LibraryItemProperty, String> properties) { - if (properties.containsKey (property)) - return properties.get (property); - else - return "Unknown"; - } -} + super (properties); + } +}
\ No newline at end of file |