|
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.CDID
public class CDID
CDID represents a unique music CD with the characteristics usually provided by a CDDrive. This entry can be used to query additional information for the CD from services like CDDB
CDDrive,
CDDB,
Serialized Form| Constructor Summary | |
|---|---|
CDID(CDDrive cddrive)
reads the CD information directly from the drive (preferred construction method) |
|
CDID(String queryString)
parses the CDID information from the given CDDB query string. |
|
CDID(String id,
int[] offset,
int length)
constructs the CDID manually (doesn't perform a consistency check) |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
compares the query string for identity |
String |
getDiscID()
The returned discid can be used to match this CD to a CDDBRecord. |
int |
getFrameOffset(int track)
returns the offset of the frame on the CD where the given track starts. |
int |
getLength()
returns the duration of the CD in seconds |
int |
getNumberOfTracks()
this is equivalent to the number of frame offsets |
String |
getQueryString()
returns the query string in CDDB format |
int |
getTrackLength(int trackNo)
returns the duration of the track in seconds; trackNo specifies track 0 to (getNumberOfTracks() - 1). |
int |
hashCode()
hashes the discID |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CDID(String id,
int[] offset,
int length)
public CDID(CDDrive cddrive)
throws IllegalArgumentException
IllegalArgumentException
public CDID(String queryString)
throws NumberFormatException,
ArrayIndexOutOfBoundsException
This constructor is useful for importing CDIDs from a file or the alike; it does not check the validity/consistency of the string, though.
queryString - a string in the exact format specified by the
CDDB protocol for querying a CD.
NumberFormatException - if the string cannot be parsed properly
ArrayIndexOutOfBoundsException - if the string cannot be parsed properlyCDDrive.getQueryString()| Method Detail |
|---|
public String getDiscID()
CDDBRecord.getDiscID()public int getLength()
public int getFrameOffset(int track)
getNumberOfTracks()-1.
public int getNumberOfTracks()
public int getTrackLength(int trackNo)
public String getQueryString()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||