| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AbstractTag |
|
| 1.2857142857142858;1.286 |
| 1 | /** | |
| 2 | * @author : Paul Taylor | |
| 3 | * @author : Eric Farng | |
| 4 | * | |
| 5 | * Version @version:$Id: AbstractTag.java,v 1.2 2008/01/01 15:14:21 paultaylor Exp $ | |
| 6 | * | |
| 7 | * MusicTag Copyright (C)2003,2004 | |
| 8 | * | |
| 9 | * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser | |
| 10 | * General Public License as published by the Free Software Foundation; either version 2.1 of the License, | |
| 11 | * or (at your option) any later version. | |
| 12 | * | |
| 13 | * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even | |
| 14 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| 15 | * See the GNU Lesser General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU Lesser General Public License along with this library; if not, | |
| 18 | * you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software | |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 20 | * | |
| 21 | * Description:This class represents any type of tag in an MP3 file, including ID3 and | |
| 22 | * Lyrics and the file name. | |
| 23 | */ | |
| 24 | package org.jaudiotagger.tag.id3; | |
| 25 | ||
| 26 | import java.io.IOException; | |
| 27 | import java.io.RandomAccessFile; | |
| 28 | import java.nio.ByteBuffer; | |
| 29 | import java.util.Iterator; | |
| 30 | ||
| 31 | /** | |
| 32 | * A tag is term given to a container that holds audio metadata | |
| 33 | */ | |
| 34 | public abstract class AbstractTag extends AbstractTagItem | |
| 35 | { | |
| 36 | protected static final String TYPE_TAG = "tag"; | |
| 37 | ||
| 38 | ||
| 39 | public AbstractTag() | |
| 40 | 2081 | { |
| 41 | 2081 | } |
| 42 | ||
| 43 | public AbstractTag(AbstractTag copyObject) | |
| 44 | { | |
| 45 | 0 | super(copyObject); |
| 46 | 0 | } |
| 47 | ||
| 48 | /** | |
| 49 | * Looks for this tag in the buffer | |
| 50 | * | |
| 51 | * @param byteBuffer | |
| 52 | * @return returns true if found, false otherwise. | |
| 53 | */ | |
| 54 | abstract public boolean seek(ByteBuffer byteBuffer); | |
| 55 | ||
| 56 | /** | |
| 57 | * Writes the tag to the file | |
| 58 | * | |
| 59 | * @param file | |
| 60 | * @throws IOException | |
| 61 | */ | |
| 62 | public abstract void write(RandomAccessFile file) throws IOException; | |
| 63 | ||
| 64 | ||
| 65 | /** | |
| 66 | * Removes the specific tag from the file | |
| 67 | * | |
| 68 | * @param file MP3 file to append to. | |
| 69 | * @throws IOException on any I/O error | |
| 70 | */ | |
| 71 | abstract public void delete(RandomAccessFile file) throws IOException; | |
| 72 | ||
| 73 | ||
| 74 | /** | |
| 75 | * Determines whether another datatype is equal to this tag. It just compares | |
| 76 | * if they are the same class, then calls <code>super.equals(obj)</code>. | |
| 77 | * | |
| 78 | * @param obj The object to compare | |
| 79 | * @return if they are equal | |
| 80 | */ | |
| 81 | public boolean equals(Object obj) | |
| 82 | { | |
| 83 | 0 | if ((obj instanceof AbstractTag) == false) |
| 84 | { | |
| 85 | 0 | return false; |
| 86 | } | |
| 87 | ||
| 88 | 0 | return super.equals(obj); |
| 89 | } | |
| 90 | ||
| 91 | /** | |
| 92 | * @return | |
| 93 | */ | |
| 94 | abstract public Iterator iterator(); | |
| 95 | } | |
| 96 | ||
| 97 | ||
| 98 |