sk.baka.ambient.library
Class GenreCache

java.lang.Object
  extended by sk.baka.ambient.library.GenreCache

public final class GenreCache
extends Object

Handles genre cache and new genre creation.

Author:
Martin Vysny

Constructor Summary
GenreCache(DBStrategy backend)
          Creates new genre cache.
 
Method Summary
 Set<Long> register(String genres)
          Registers a genre and returns a list of ids of registered genres.
static Iterable<String> splitGenres(String genreList)
          Split given genre list (genres separated by , or ;).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenreCache

GenreCache(DBStrategy backend)
Creates new genre cache.

Parameters:
backend - the backend.
Method Detail

register

public Set<Long> register(String genres)
Registers a genre and returns a list of ids of registered genres.

Parameters:
genres - the genre to register, a comma-separated list of genres.
Returns:
read-only list of genre database ids.

splitGenres

public static Iterable<String> splitGenres(String genreList)
Split given genre list (genres separated by , or ;).

Parameters:
genreList - the list to split. If null is given then an empty iterable is returned.
Returns:
tokens. use String.trim() to get rid of surrounding whitespaces.


Copyright © 2007-2008. All Rights Reserved.