Holger's
Java API

com.antelmann.cddb
Class Genre

java.lang.Object
  extended by com.antelmann.cddb.Genre
All Implemented Interfaces:
Serializable, Comparable<Genre>

public class Genre
extends Object
implements Serializable, Comparable<Genre>

A Genre specifies the category for a composition.

Author:
Holger Antelmann
See Also:
Contribution, Track, Composition, Resource, Serialized Form

Field Summary
static Genre BLUES
           
static Genre CLASSICAL
           
static Genre COUNTRY
           
static Genre DATA
           
static Genre FOLK
           
static Genre JAZZ
           
static Genre MISC
           
static Genre NEWAGE
           
static Genre REGGAE
           
static Genre ROCK
           
static Genre SOUNDTRACK
           
static Genre UNKNOWN
           
 
Constructor Summary
protected Genre(String description)
           
 
Method Summary
 int compareTo(Genre g)
           
 boolean equals(Object obj)
           
static Genre getGenre(String description)
          convenience method that checks whether the given description matches one of the standard categories (using case-insensitive comparison), in which case the static member is returned; otherwise, NoSuchElementException is thrown.
static Genre[] getKnownGenres()
           
 int hashCode()
           
static boolean isKnownGenre(Genre genre)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BLUES

public static final Genre BLUES

CLASSICAL

public static final Genre CLASSICAL

COUNTRY

public static final Genre COUNTRY

DATA

public static final Genre DATA

FOLK

public static final Genre FOLK

JAZZ

public static final Genre JAZZ

MISC

public static final Genre MISC

NEWAGE

public static final Genre NEWAGE

REGGAE

public static final Genre REGGAE

ROCK

public static final Genre ROCK

SOUNDTRACK

public static final Genre SOUNDTRACK

UNKNOWN

public static final Genre UNKNOWN
Constructor Detail

Genre

protected Genre(String description)
Method Detail

isKnownGenre

public static boolean isKnownGenre(Genre genre)

getGenre

public static Genre getGenre(String description)
                      throws NoSuchElementException
convenience method that checks whether the given description matches one of the standard categories (using case-insensitive comparison), in which case the static member is returned; otherwise, NoSuchElementException is thrown.

Throws:
NoSuchElementException - if the given description doesn't match with a known genre

getKnownGenres

public static Genre[] getKnownGenres()

compareTo

public int compareTo(Genre g)
Specified by:
compareTo in interface Comparable<Genre>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads