FileDocCategorySizeDatePackage
TCOMTextInformationID3V2Frame.javaAPI Docjid3 0.465155Sun Feb 06 18:11:19 GMT 2005org.blinkenlights.jid3.v2

TCOMTextInformationID3V2Frame

public class TCOMTextInformationID3V2Frame extends TextInformationID3V2Frame
author
paul Text frame which contains the composer(s) of the track.

Fields Summary
private String[]
m_asComposer
Constructors Summary
public TCOMTextInformationID3V2Frame(String sComposer)
Constructor.

param
sComposer the composer(s) of this track (multiple composers separated by forward-slash)

    
                      
      
    
        super(sComposer);
        
        m_asComposer = getComposers(sComposer);
    
public TCOMTextInformationID3V2Frame(String[] asComposer)
Constructor.

param
asComposer the composer(s) of this track

        super("");
        
        // build single string of composers, separated by "/", as described in ID3 spec
        StringBuffer sbComposers = new StringBuffer();
        for (int i=0; i < asComposer.length; i++)
        {
            sbComposers.append(asComposer[i] + "/");
        }
        sbComposers.deleteCharAt(sbComposers.length()-1);   // delete last "/"
        m_sInformation = sbComposers.toString();
        
        m_asComposer = getComposers(m_sInformation);
    
public TCOMTextInformationID3V2Frame(InputStream oIS)

        super(oIS);
        
        m_asComposer = getComposers(m_sInformation);
    
Methods Summary
public voidaccept(ID3Visitor oID3Visitor)

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

        if ((oOther == null) || (!(oOther instanceof TCOMTextInformationID3V2Frame)))
        {
            return false;
        }
        
        TCOMTextInformationID3V2Frame oOtherTCOM = (TCOMTextInformationID3V2Frame)oOther;
        
        return (m_sInformation.equals(oOtherTCOM.m_sInformation) &&
                m_oTextEncoding.equals(oOtherTCOM.m_oTextEncoding) &&
                Arrays.equals(m_asComposer, oOtherTCOM.m_asComposer));
    
private java.lang.String[]getComposers(java.lang.String sValue)
Split a string containing potentially several distinct values (forward-slash separated) into an array of Strings, one value per String.

param
sValue value to be separated
return
an array of values

        String[] asComposer = sValue.split("/");
        
        return asComposer;
    
public java.lang.String[]getComposers()
Get the composer(s) of this track.

return
the composer(s) of this track

        return m_asComposer;
    
protected byte[]getFrameId()

        return "TCOM".getBytes();
    
public voidsetComposer(java.lang.String sComposer)
Set the composer(s) of this track. Multiple composers can optionally be set with this method by separating them with a slash "/" character.

param
sComposer the composer of this track

        m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
        m_sInformation = sComposer;
        m_asComposer = getComposers(sComposer);
    
public voidsetComposers(java.lang.String[] asComposer)
Set the composer(s) of this track.

param
asComposer the composers of this track

        // build single string of composers, separated by "/", as described in ID3 spec
        StringBuffer sbComposers = new StringBuffer();
        for (int i=0; i < asComposer.length; i++)
        {
            sbComposers.append(asComposer[i] + "/");
        }
        sbComposers.deleteCharAt(sbComposers.length()-1);   // delete last "/"
        m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
        m_sInformation = sbComposers.toString();
        
        m_asComposer = getComposers(m_sInformation);
    
public java.lang.StringtoString()

        return "Composer(s): [" + m_sInformation + "]";