|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.musicontroller.dao.BagAndKeywordUtils
public class BagAndKeywordUtils
This class manages persistent keyword bag objects.
| Constructor Summary | |
|---|---|
BagAndKeywordUtils()
|
|
| Method Summary | |
|---|---|
static Keywordbag |
addKeywordToBag(Keywordbag bag,
Keyword keyword)
Tries to find a keyword bag containing all the keywords in this bag plus the keyword in the parameter. |
static void |
addKeywordToSong(Song song,
Keyword kw)
Add a keyword to the song. |
static java.util.List<AiRelationBean> |
buildAiRelationBeanList(Playlist playlist)
Constructs a list of AiRelationBean objects from a playlist. |
static java.util.Set<AIRelation> |
buildAiRelationList(java.util.List<AiRelationBean> source)
Converts the Set of AiRelationBean objects into a Set of AiRelation objects. |
static java.util.Set<AIRelation> |
createRelations(java.lang.String artistfirstname,
java.lang.String artistlastname,
Band band,
java.lang.String instruments)
Construct a set of artist-instrument relations corresponding to an artist with the supplied first name and last name and the specified instrument names. |
static AIBag |
getAIBag(java.util.Set<AIRelation> relations)
Returns an artist_instrument bag containing exactly the artist-instrument relations specified in the argument. |
static java.util.List<AIBag> |
getAIBags()
Getter for the list of Artist-Instrument bag objects. |
static java.util.List<Keywordbag> |
getBags()
Getter for the list of keyword bag objects. |
Dao |
getDao()
Getter for the DAO. |
static Keyword |
getKeyword(java.lang.String keywordname)
Locates the keyword in the database or constructs a new keyword if there isn't one already. |
static Keywordbag |
getKeywordBag(java.util.Collection<Keyword> keywords)
Returns a persistent keyword bag containing exactly the keywords in the parameter. |
static Keywordbag |
getKeywordBag(java.lang.String songKeywords)
Returns a keyword bag containing exactly the keywords specified as comma separated keywords in the argument. |
static java.util.List<Keyword> |
getKeywordList(java.lang.String keywords)
Returns a list of keywords corresponding to the comma separated list of keywords in the parameter. |
static java.lang.String |
listKeywords(Keywordbag bag)
Returns a String representation of all keywords in the bag, listing all keywords separated by commas. |
static Keywordbag |
removeKeyWordFromBag(Keywordbag bag,
Keyword keyword)
Tries to find a keyword bag with all keywords of this bag minus the parameter keyword. |
void |
setDao(Dao dao)
Setter for the DAO. |
static java.util.List<Instrument> |
splitInstrumentList(java.lang.String instruments)
Splits the string into comma separated instrument names and returns a list with instruments with the names in the list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BagAndKeywordUtils()
| Method Detail |
|---|
public static Keywordbag addKeywordToBag(Keywordbag bag,
Keyword keyword)
bag - The keyword bag to add the keyword to.keyword - The keyword to add.
public static Keywordbag removeKeyWordFromBag(Keywordbag bag,
Keyword keyword)
bag - The bag to remove the keyword from.keyword - The keyword to exclude.
public static void addKeywordToSong(Song song,
Keyword kw)
song - The song.kw - The keyword to add.public static Keyword getKeyword(java.lang.String keywordname)
keywordname - The sought keyword name.
public static Keywordbag getKeywordBag(java.lang.String songKeywords)
songKeywords - A comma separated list of Keywords.
public static Keywordbag getKeywordBag(java.util.Collection<Keyword> keywords)
keywords - The list of keywords.
public static java.util.List<Keyword> getKeywordList(java.lang.String keywords)
keywords - The comma separted list of keywords.
public static AIBag getAIBag(java.util.Set<AIRelation> relations)
relations - The set of artist instrument relations that must be present
in the result.
public static java.lang.String listKeywords(Keywordbag bag)
bag - The keyword bag to list.
public static java.util.List<Keywordbag> getBags()
public static java.util.List<AIBag> getAIBags()
public Dao getDao()
public void setDao(Dao dao)
dao - The DAO.public static java.util.List<AiRelationBean> buildAiRelationBeanList(Playlist playlist)
playlist - The playlist to build the aiRelationBeanList for.
public static java.util.Set<AIRelation> buildAiRelationList(java.util.List<AiRelationBean> source)
source - The set of AiRelationBean objects to convert.
public static java.util.List<Instrument> splitInstrumentList(java.lang.String instruments)
instruments - The comma separated list of instruments.
public static java.util.Set<AIRelation> createRelations(java.lang.String artistfirstname,
java.lang.String artistlastname,
Band band,
java.lang.String instruments)
artistfirstname - The first name of the artist.artistlastname - The last name of the artist.band - A band the artist is a part of (or null).instruments - The comma separated list of instruments.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||