com.neoworks.jukex
Interface Track

All Known Implementing Classes:
JukeXTrack

public interface Track

The Track class encapsulates all information about a single music track.

Author:
Nick Vincent (nick@neoworks.com)

Method Summary
 void addAttributeValue(Attribute attribute, AttributeValue value)
          Adds an AttributeValue to an existing Attribute on this Track.
 void clearAttribute(Attribute attribute)
          Removes all of the values for this track from the passed Attribute
 AttributeValue getAttributeValue(Attribute attribute)
          Gets the first AttributeValue belonging to the passed attribute
 AttributeValue getAttributeValue(java.lang.String attributename)
          Gets the first AttributeValue belonging to the Attribute referred to by the passed String.
 java.util.Collection getAttributeValues(Attribute attribute)
          Retrieve all of the AttributeValue objects corresponding to the given Attribute.
 long getId()
          Return the database ID of this Track
 java.util.Collection getKnownAttributes()
          Retrieve a Collection of all Attribute objects which this track has.
 java.util.Date getUpdatedDate()
          Return the last time that this Track was updated in the database.
 java.net.URL getURL()
          Return the URL of the Track's location
 void replaceAttributeValues(Attribute attribute, AttributeValue value)
          Replace all of the current attribute values with the one passed
 void setUpdatedDate(java.util.Date updatedDate)
          Set the time that this Track was updated.
 

Method Detail

getAttributeValues

public java.util.Collection getAttributeValues(Attribute attribute)
Retrieve all of the AttributeValue objects corresponding to the given Attribute. This, for instance, could allow you to get all of the artists who performed on a Track by passing an Attribute object representing the 'performer' attribute.

Parameters:
attribute - The Attribute for which the values are to be retrieved
Returns:
A Collection of AttributeValue objects

getKnownAttributes

public java.util.Collection getKnownAttributes()
Retrieve a Collection of all Attribute objects which this track has.

Returns:
A Collection of all Attribute objects which this track has.

clearAttribute

public void clearAttribute(Attribute attribute)
Removes all of the values for this track from the passed Attribute

Parameters:
attribute - The Attribute to remove the values of

replaceAttributeValues

public void replaceAttributeValues(Attribute attribute,
                                   AttributeValue value)
Replace all of the current attribute values with the one passed

Parameters:
attribute - The Attribute to have its values changed
value - The AttributeValue to become the new value

addAttributeValue

public void addAttributeValue(Attribute attribute,
                              AttributeValue value)
Adds an AttributeValue to an existing Attribute on this Track.

Parameters:
attribute - The Attribute to whom the value is to be added
value - The AttributeValue to add

getURL

public java.net.URL getURL()
Return the URL of the Track's location

Returns:
The URL where the Track can be found

getId

public long getId()
Return the database ID of this Track

Returns:
The database ID of this Track

getUpdatedDate

public java.util.Date getUpdatedDate()
Return the last time that this Track was updated in the database. Note that this is only triggered by setUpdatedDate, and not by any alterations made to Attributes/AttributeValues.

Returns:
The last time the track was updated.

setUpdatedDate

public void setUpdatedDate(java.util.Date updatedDate)
Set the time that this Track was updated. This takes a parameter to avoid time problems where the clocks on many systems maybe slightly out of sync and mean that suddenly all tracks are updated in the future.

Parameters:
updatedDate - The updated Date to attach to the track.

getAttributeValue

public AttributeValue getAttributeValue(Attribute attribute)
Gets the first AttributeValue belonging to the passed attribute

Parameters:
attribute - The Attribute whose values we are retrieving

getAttributeValue

public AttributeValue getAttributeValue(java.lang.String attributename)
Gets the first AttributeValue belonging to the Attribute referred to by the passed String. This is a convenience method in order that code may be more concise.

Parameters:
attributename - The name of the Attribute whose first value is to be retrieved.