Lizzy v1.1.1

christophedelory.playlist.xspf
Class Track

java.lang.Object
  extended by christophedelory.playlist.xspf.Attribution
      extended by christophedelory.playlist.xspf.Track

public class Track
extends Attribution

A XSPF track.

Version:
$Revision: 92 $
Author:
Christophe Delory

Constructor Summary
Track()
           
 
Method Summary
 void addExtension(Object extension)
          Adds an extension to this track.
 void addLink(Link link)
          Adds a link to this track.
 void addMeta(Meta meta)
          Adds a metadata to this playlist.
 String getAlbum()
          Returns a human-readable name of the collection from which the resource which defines the duration of track rendering comes.
 String getAnnotation()
          Returns a human-readable comment on the track.
 String getCreator()
          Returns a human-readable name of the entity (author, authors, group, company, etc) that authored the resource which defines the duration of track rendering.
 Integer getDuration()
          Returns the time to render a resource, in milliseconds.
 List<AnyNode> getExtensions()
          Returns a list of track extensions.
 String getImage()
          Returns an URI of an image to display for the duration of the track.
 String getInfo()
          Returns an URI of a place where this resource can be bought or more info can be found.
 List<Link> getLinks()
          Returns the list of links defined in this track.
 List<Meta> getMetas()
          Returns the list of metadata defined in this playlist.
 String getTitle()
          Returns a human-readable name of the track that authored the resource which defines the duration of track rendering.
 Integer getTrackNumber()
          Returns an integer with value greater than zero giving the ordinal position of the media on the xspf:album.
 void setAlbum(String album)
          Initializes a human-readable name of the collection from which the resource which defines the duration of track rendering comes.
 void setAnnotation(String annotation)
          Initializes a human-readable comment on the track.
 void setCreator(String creator)
          Initializes a human-readable name of the entity (author, authors, group, company, etc) that authored the resource which defines the duration of track rendering.
 void setDuration(int duration)
          Initializes the time to render a resource, in milliseconds.
 void setDuration(Integer duration)
          Initializes the time to render a resource, in milliseconds.
 void setImage(String image)
          Initializes an URI of an image to display for the duration of the track.
 void setInfo(String info)
          Initializes an URI of a place where this resource can be bought or more info can be found.
 void setTitle(String title)
          Initializes a human-readable name of the track that authored the resource which defines the duration of track rendering.
 void setTrackNumber(Integer trackNum)
          Initializes an integer with value greater than zero giving the ordinal position of the media on the xspf:album.
 
Methods inherited from class christophedelory.playlist.xspf.Attribution
addStringContainer, getStringContainers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Track

public Track()
Method Detail

getTitle

public String getTitle()
Returns a human-readable name of the track that authored the resource which defines the duration of track rendering. This value is primarily for fuzzy lookups, though a user-agent may display it.

Returns:
a title. May be null.
See Also:
setTitle(java.lang.String)

setTitle

public void setTitle(String title)
Initializes a human-readable name of the track that authored the resource which defines the duration of track rendering.

Parameters:
title - a title. May be null.
See Also:
getTitle()

getCreator

public String getCreator()
Returns a human-readable name of the entity (author, authors, group, company, etc) that authored the resource which defines the duration of track rendering. This value is primarily for fuzzy lookups, though a user-agent may display it.

Returns:
a creator. May be null.
See Also:
setCreator(java.lang.String)

setCreator

public void setCreator(String creator)
Initializes a human-readable name of the entity (author, authors, group, company, etc) that authored the resource which defines the duration of track rendering.

Parameters:
creator - a creator. May be null.
See Also:
getCreator()

getAnnotation

public String getAnnotation()
Returns a human-readable comment on the track. This is character data, not HTML, and it may not contain markup.

Returns:
an annotation. May be null.
See Also:
setAnnotation(java.lang.String)

setAnnotation

public void setAnnotation(String annotation)
Initializes a human-readable comment on the track.

Parameters:
annotation - an annotation. May be null.
See Also:
getAnnotation()

getInfo

public String getInfo()
Returns an URI of a place where this resource can be bought or more info can be found.

Returns:
an information. May be null.
See Also:
setInfo(java.lang.String)

setInfo

public void setInfo(String info)
Initializes an URI of a place where this resource can be bought or more info can be found.

Parameters:
info - an information. May be null.
See Also:
getInfo()

getImage

public String getImage()
Returns an URI of an image to display for the duration of the track.

Returns:
an image. May be null.
See Also:
setImage(java.lang.String)

setImage

public void setImage(String image)
Initializes an URI of an image to display for the duration of the track.

Parameters:
image - an image. May be null.
See Also:
getImage()

getAlbum

public String getAlbum()
Returns a human-readable name of the collection from which the resource which defines the duration of track rendering comes. For a song originally published as a part of a CD or LP, this would be the title of the original release. This value is primarily for fuzzy lookups, though a user-agent may display it.

Returns:
an album. May be null.
See Also:
setAlbum(java.lang.String)

setAlbum

public void setAlbum(String album)
Initializes a human-readable name of the collection from which the resource which defines the duration of track rendering comes.

Parameters:
album - an album. May be null.
See Also:
getAlbum()

getTrackNumber

public Integer getTrackNumber()
Returns an integer with value greater than zero giving the ordinal position of the media on the xspf:album. This value is primarily for fuzzy lookups, though a user-agent may display it.

Returns:
a track number. May be null.
See Also:
setTrackNumber(java.lang.Integer)

setTrackNumber

public void setTrackNumber(Integer trackNum)
Initializes an integer with value greater than zero giving the ordinal position of the media on the xspf:album.

Parameters:
trackNum - a track number. May be null.
Throws:
IllegalArgumentException - if the specified track number is not stricly positive.
See Also:
getTrackNumber()

getDuration

public Integer getDuration()
Returns the time to render a resource, in milliseconds. This value is only a hint: different XSPF generators will generate slightly different values. A user-agent MUST NOT use this value to determine the rendering duration, since the data will likely be low quality.

Returns:
a duration. May be null.
See Also:
setDuration(java.lang.Integer)

setDuration

public void setDuration(Integer duration)
Initializes the time to render a resource, in milliseconds.

Parameters:
duration - a duration. May be null.
Throws:
IllegalArgumentException - if the specified duration is not stricly positive.
See Also:
getDuration(), setDuration(int)

setDuration

public void setDuration(int duration)
Initializes the time to render a resource, in milliseconds.

Parameters:
duration - a duration.
Throws:
IllegalArgumentException - if the duration is not stricly positive.
See Also:
getDuration(), setDuration(Integer)

getExtensions

public List<AnyNode> getExtensions()
Returns a list of track extensions. This element allows non-XSPF XML to be included in XSPF documents. The purpose is to allow nested XML, which the meta and link elements do not.

Returns:
a list of extensions. May be empty but not null.
See Also:
addExtension(java.lang.Object)

addExtension

public void addExtension(Object extension)
Adds an extension to this track.
The extension element must have an "application" attribute. It's the URI of a resource defining the structure and purpose of the nested XML.
The input type is an Object just because it's what the Castor framework expects.

Parameters:
extension - an extension. Shall not be null.
Throws:
NullPointerException - if extension is null.
IllegalArgumentException - if extension is not an AnyNode instance.
IllegalArgumentException - if no "application" attribute can be found in the specified extension element.
See Also:
getExtensions()

addLink

public void addLink(Link link)
Adds a link to this track.

Parameters:
link - a link. Shall not be null
Throws:
NullPointerException - if link is null.
See Also:
getLinks()

getLinks

public List<Link> getLinks()
Returns the list of links defined in this track. The link element allows XSPF to be extended without the use of XML namespaces.

Returns:
a list of links. May be empty but not null.
See Also:
addLink(christophedelory.playlist.xspf.Link)

addMeta

public void addMeta(Meta meta)
Adds a metadata to this playlist.

Parameters:
meta - a metadata. Shall not be null
Throws:
NullPointerException - if meta is null.
See Also:
getMetas()

getMetas

public List<Meta> getMetas()
Returns the list of metadata defined in this playlist. The meta element allows metadata fields to be added to xspf:track elements.

Returns:
a list of metadata. May be empty but not null.
See Also:
addMeta(christophedelory.playlist.xspf.Meta)

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.