FileDocCategorySizeDatePackage
Lyrics3Image.javaAPI DocJaudiotagger 2.0.46217Wed Mar 30 16:12:12 BST 2011org.jaudiotagger.tag.datatype

Lyrics3Image

public class Lyrics3Image extends AbstractDataType
author
: Paul Taylor
author
: Eric Farng Version @version:$Id: Lyrics3Image.java 836 2009-11-12 15:44:07Z paultaylor $ MusicTag Copyright (C)2003,2004 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Description:

Fields Summary
private Lyrics3TimeStamp
time
private String
description
private String
filename
Constructors Summary
public Lyrics3Image(String identifier, org.jaudiotagger.tag.id3.AbstractTagFrameBody frameBody)
Creates a new ObjectLyrics3Image datatype.

param
identifier
param
frameBody


                  
        
    
        super(identifier, frameBody);
    
public Lyrics3Image(Lyrics3Image copy)

        super(copy);
        this.time = new Lyrics3TimeStamp(copy.time);
        this.description = copy.description;
        this.filename = copy.filename;
    
Methods Summary
public booleanequals(java.lang.Object obj)

param
obj
return

        if (!(obj instanceof Lyrics3Image))
        {
            return false;
        }

        Lyrics3Image object = (Lyrics3Image) obj;

        if (!this.description.equals(object.description))
        {
            return false;
        }

        if (!this.filename.equals(object.filename))
        {
            return false;
        }

        if (this.time == null)
        {
            if (object.time != null)
            {
                return false;
            }
        }
        else
        {
            if (!this.time.equals(object.time))
            {
                return false;
            }
        }

        return super.equals(obj);
    
public java.lang.StringgetDescription()

return

        return this.description;
    
public java.lang.StringgetFilename()

return

        return this.filename;
    
public intgetSize()

return

        int size;

        size = filename.length() + 2 + description.length() + 2;

        if (time != null)
        {
            size += time.getSize();
        }

        return size;
    
public Lyrics3TimeStampgetTimeStamp()

return

        return this.time;
    
public voidreadByteArray(byte[] arr, int offset)

        readString(arr.toString(), offset);
    
public voidreadString(java.lang.String imageString, int offset)

param
imageString
param
offset
throws
NullPointerException
throws
IndexOutOfBoundsException

        if (imageString == null)
        {
            throw new NullPointerException("Image string is null");
        }

        if ((offset < 0) || (offset >= imageString.length()))
        {
            throw new IndexOutOfBoundsException("Offset to image string is out of bounds: offset = " + offset + ", string.length()" + imageString.length());
        }

        if (imageString != null)
        {
            String timestamp;
            int delim;

            delim = imageString.indexOf("||", offset);
            filename = imageString.substring(offset, delim);

            offset = delim + 2;
            delim = imageString.indexOf("||", offset);
            description = imageString.substring(offset, delim);

            offset = delim + 2;
            timestamp = imageString.substring(offset);

            if (timestamp.length() == 7)
            {
                time = new Lyrics3TimeStamp("Time Stamp");
                time.readString(timestamp);
            }
        }
    
public voidsetDescription(java.lang.String description)

param
description

        this.description = description;
    
public voidsetFilename(java.lang.String filename)

param
filename

        this.filename = filename;
    
public voidsetTimeStamp(Lyrics3TimeStamp time)

param
time

        this.time = time;
    
public java.lang.StringtoString()

return

        String str;
        str = "filename = " + filename + ", description = " + description;

        if (time != null)
        {
            str += (", timestamp = " + time.toString());
        }

        return str + "\n";
    
public byte[]writeByteArray()

        return Utils.getDefaultBytes(writeString(), "ISO-8859-1");
    
public java.lang.StringwriteString()

return

        String str;

        if (filename == null)
        {
            str = "||";
        }
        else
        {
            str = filename + "||";
        }

        if (description == null)
        {
            str += "||";
        }
        else
        {
            str += (description + "||");
        }

        if (time != null)
        {
            str += time.writeString();
        }

        return str;