|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.cddb.CDDBEntry
public class CDDBEntry
CDDBEntry represents an entry for a CD in a CDDB database that contains all known properties about the associated CD.
CDDBEntry also contains methods to generate Artist and Composition objects to bridge from a CDDB database to a more sophisticated internal CD database.
CDDBXmcdParser,
Composition,
Artist,
Serialized Form| Constructor Summary | |
|---|---|
CDDBEntry(CDDBRecord record,
String fileContent)
The fileContent must be in xmcd format specified by CDDB and must contain the discID from the record. |
|
| Method Summary | |
|---|---|
Artist |
extractCDArtist()
returns the artist defined for the CD or null if none was found |
Composition |
extractComposition(boolean includeTracks)
creates a default Composition object from the embedded CDInfo that regards the entire CD as one composition and will contain certain Composition objects as far as applicable. |
Artist |
extractTrackArtist(int track)
returns the artist defined for the track or null if none was found |
Track[] |
extractTracks(boolean addArtist)
generates default Track objects that - if addArtist is true - contain applicable contributions |
CDDBRecord |
getCDDBRecord()
returns the associated CDDBRecord entry. |
CDID |
getCDID()
returns the associated CDID object |
Properties |
getProperties()
a convenience method that returns a map view of all known properties of this entry. |
String |
getXmcdContent()
returns the content in xmcd file format as specified by CDDB. |
void |
saveToDirectory(File dir)
saves the content of the entry into a file in the given directory according to standard CDDB conventions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CDDBEntry(CDDBRecord record,
String fileContent)
throws ParseException,
XmcdFormatException
ParseException - if the fileContent is not in valid xmcd format
or inconsistent with the given record
XmcdFormatException| Method Detail |
|---|
public String getXmcdContent()
CDInfo
getXmcdContent in interface CDInfoCDInfo.getCDDBRecord(),
CDDBXmcdParserpublic CDDBRecord getCDDBRecord()
CDInfoisExactMatch() value of this returned instance
is meaningless. This record (with the embedded category and one discID)
allows to identify the CDInfo object as to how it is to be filed.
getCDDBRecord in interface CDInfoCDDB.queryCD(CDID)public CDID getCDID()
CDInfo
getCDID in interface CDInfopublic Properties getProperties()
CDInfo
getProperties in interface CDInfo
public void saveToDirectory(File dir)
throws IOException
The file will be saved in a subdirectory specified by the category and the filename will be the discID. The file content is the raw CDDB format. If the file already exists, an IOException will be thrown.
IOException
public Composition extractComposition(boolean includeTracks)
throws XmcdFormatException
includeTracks - if true, the generated Composition object
will already contain all tracks from the
embedded CDInfo
XmcdFormatException
public Track[] extractTracks(boolean addArtist)
throws XmcdFormatException
XmcdFormatException
public Artist extractCDArtist()
throws XmcdFormatException
XmcdFormatException
public Artist extractTrackArtist(int track)
throws XmcdFormatException
XmcdFormatException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||