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

TORYTextInformationID3V2Frame

public class TORYTextInformationID3V2Frame extends TextInformationID3V2Frame
author
paul Text frame containing the original release year of the recording in this track.

Fields Summary
private int
m_iOriginalReleaseYear
Constructors Summary
public TORYTextInformationID3V2Frame(int iOriginalReleaseYear)
Constructor.

param
iOriginalReleaseYear the year in which the recording in this track was originally released
throws
ID3Exception if the year is outside of the range from 0 to 9999

        super(getYearString(iOriginalReleaseYear));

        // it is required that the year value string be four characters long              
        if ((iOriginalReleaseYear < 0) || (iOriginalReleaseYear > 9999))
        {
            throw new ID3Exception("Year in TORY tag must be between 0 and 9999.");
        }
        
        m_iOriginalReleaseYear = iOriginalReleaseYear;
    
public TORYTextInformationID3V2Frame(InputStream oIS)

        super(oIS);
        
        try
        {
            m_iOriginalReleaseYear = Integer.parseInt(m_sInformation);
        }
        catch (Exception e)
        {
            throw new InvalidFrameID3Exception("Encountered a corrupt TORY original copyright year frame.", e);
        }
    
Methods Summary
public voidaccept(ID3Visitor oID3Visitor)

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

        if ((oOther == null) || (!(oOther instanceof TORYTextInformationID3V2Frame)))
        {
            return false;
        }
        
        TORYTextInformationID3V2Frame oOtherTORY = (TORYTextInformationID3V2Frame)oOther;
        
        return ( (m_iOriginalReleaseYear == oOtherTORY.m_iOriginalReleaseYear) &&
                 m_oTextEncoding.equals(oOtherTORY.m_oTextEncoding) &&
                 m_sInformation.equals(oOtherTORY.m_sInformation) );
    
protected byte[]getFrameId()

        return "TORY".getBytes();
    
public intgetOriginalReleaseYear()
Get the original release year of the recording in this track.

return
the original release year of the recording in this track

        return m_iOriginalReleaseYear;
    
private static java.lang.StringgetYearString(int iYear)
Internal method to return the year value as a four digit string.

        NumberFormat oNF = new DecimalFormat("0000");
        
        return oNF.format(iYear);
    
public voidsetOriginalReleaseYear(int iOriginalReleaseYear)
Set the original release year of the recording in this track.

param
iOriginalReleaseYear the year in which the recording in this track was originally released
throws
ID3Exception if the year is outside of the range from 0 to 9999

        // it is required that the year value string be four characters long              
        if ((iOriginalReleaseYear < 0) || (iOriginalReleaseYear > 9999))
        {
            throw new ID3Exception("Year in TORY tag must be between 0 and 9999.");
        }
        
        m_iOriginalReleaseYear = iOriginalReleaseYear;
        m_oTextEncoding = TextEncoding.getDefaultTextEncoding();
        m_sInformation = getYearString(iOriginalReleaseYear);
    
public java.lang.StringtoString()

        return "Original release year: [" + m_sInformation + "]";