net.shredzone.ifish.db
Class DbEntry

java.lang.Object
  extended by net.shredzone.ifish.db.Entry
      extended by net.shredzone.ifish.db.DbEntry
All Implemented Interfaces:
Serializable, Comparable<Entry>

public class DbEntry
extends Entry
implements Serializable

This class represents an Entry which was read from the database.

Version:
$Id: DbEntry.java 291 2009-04-28 21:29:27Z shred $
See Also:
Serialized Form

Constructor Summary
DbEntry(File base, InputStream in, String charset)
          Create a new Entry from a file database entry.
 
Method Summary
 String getAlbum()
          Get the album of the track, as given by the file's tag.
 String getArtist()
          Get the artist of the track, as given by the file's tag.
 File getFile()
          Get the file behind this entry.
 String getFileName()
          Get the file name of this entry.
 String getGenre()
          Get the genre of the track, as given by the file's tag.
 String getTitle()
          Get the title of the track, as given by the file's tag.
 
Methods inherited from class net.shredzone.ifish.db.Entry
compareTo, equals, getBytesTerm, hashCode, size, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbEntry

public DbEntry(File base,
               InputStream in,
               String charset)
        throws IOException,
               UnsupportedEncodingException
Create a new Entry from a file database entry.

Parameters:
base - Base directory
in - Input stream within the database file
charset - Charset to be used for decoding
Throws:
IOException
UnsupportedEncodingException
Method Detail

getFile

public File getFile()
Get the file behind this entry. Returns null if there is no matching file in the file system.

Overrides:
getFile in class Entry
Returns:
File represented by this entry

getFileName

public String getFileName()
Get the file name of this entry. This is the path and file name relative to the iHP root directory mount point, and always using wrongslashes (even on unixoid systems).

Specified by:
getFileName in class Entry
Returns:
File name

getTitle

public String getTitle()
Get the title of the track, as given by the file's tag. Does not return null.

Specified by:
getTitle in class Entry
Returns:
Title

getArtist

public String getArtist()
Get the artist of the track, as given by the file's tag. Does not return null.

Specified by:
getArtist in class Entry
Returns:
Artist

getAlbum

public String getAlbum()
Get the album of the track, as given by the file's tag. Does not return null.

Specified by:
getAlbum in class Entry
Returns:
Album

getGenre

public String getGenre()
Get the genre of the track, as given by the file's tag. This is always a word, not a number. Does not return null.

Specified by:
getGenre in class Entry
Returns:
Genre


Copyright © 2007-2011 shredzone.org. All Rights Reserved.