FileDocCategorySizeDatePackage
WCOMUrlLinkID3V2Frame.javaAPI Docjid3 0.465064Sun Feb 06 18:11:16 GMT 2005org.blinkenlights.jid3.v2

WCOMUrlLinkID3V2Frame

public class WCOMUrlLinkID3V2Frame extends UrlLinkID3V2Frame
author
paul Url frame which contains commercial information pertaining to the track in this file.

Fields Summary
Constructors Summary
public WCOMUrlLinkID3V2Frame(String sCommercialInformationUrl)
Constructor.

param
sCommercialInformationUrl URL pointing to commercial information pertaining to this track
throws
ID3Exception if the URL passed is null

        super(sCommercialInformationUrl);
    
public WCOMUrlLinkID3V2Frame(URL oCommercialInformationUrl)
Constructor.

param
oCommercialInformationUrl URL pointing to commercial information pertaining to this track
throws
ID3Exception if the URL passed is null

        super(oCommercialInformationUrl);
    
public WCOMUrlLinkID3V2Frame(InputStream oIS)

        super(oIS);
    
Methods Summary
public voidaccept(ID3Visitor oID3Visitor)

        oID3Visitor.visitWCOMUrlLinkID3V2Frame(this);
    
public booleanequals(java.lang.Object oOther)

        if ((oOther == null) || (!(oOther instanceof WCOMUrlLinkID3V2Frame)))
        {
            return false;
        }
        
        WCOMUrlLinkID3V2Frame oOtherWCOM = (WCOMUrlLinkID3V2Frame)oOther;
        
        return m_sURL.equals(oOtherWCOM.m_sURL);
    
public java.lang.StringgetCommercialInformationUrl()
Get the commercial information URL for this track. Note, there is no guarantee that this value will in fact be a valid URL.

return
a string containing the set URL

        return m_sURL;
    
protected byte[]getFrameId()

        return "WCOM".getBytes();
    
public voidsetCommercialInformation(java.lang.String sCommercialInformationUrl)
Set commercial information URL for this track.

param
sCommercialInformationUrl a string containing an URL
throws
ID3Exception if the URL string passed is null, or if this frame is contained in a tag which already contains another WCOM frame with the same URL

        String sOrigURL = m_sURL;
        
        if (sCommercialInformationUrl == null)
        {
            throw new ID3Exception("Commercial information URL string cannot be null in WCOM frame.");
        }
        
        m_sURL = sCommercialInformationUrl;
        
        // try this update, and reverse it if it generates and error
        try
        {
            notifyID3Observers();
        }
        catch (ID3Exception e)
        {
            m_sURL = sOrigURL;
            
            throw e;
        }
    
public voidsetCommercialInformation(java.net.URL oCommercialInformationUrl)
Set commercial information URL for this track.

param
oCommercialInformationUrl an URL
throws
ID3Exception if the URL passed is null, or if this frame is contained in a tag which already contains another WCOM frame with the same URL

        String sOrigURL = m_sURL;
        
        if (oCommercialInformationUrl == null)
        {
            throw new ID3Exception("Commerical information URL object cannot be null in WCOM frame.");
        }
        
        m_sURL = oCommercialInformationUrl.toExternalForm();
        
        // try this update, and reverse it if it generates and error
        try
        {
            notifyID3Observers();
        }
        catch (ID3Exception e)
        {
            m_sURL = sOrigURL;
            
            throw e;
        }
    
public java.lang.StringtoString()

        return "Commercial information URL: [" + m_sURL + "]";