| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AbstractTagItem |
|
| 1.2857142857142858;1.286 |
| 1 | /** | |
| 2 | * @author : Paul Taylor | |
| 3 | * @author : Eric Farng | |
| 4 | * | |
| 5 | * Version @version:$Id: AbstractTagItem.java,v 1.5 2008/07/21 10:45:47 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: | |
| 22 | * This class is a facade for all classes that can write to an MP3 file. This includes | |
| 23 | * fragments and fragment body . It has abstract methods that needs to be implemented, | |
| 24 | * and a few default implementations of other methods. | |
| 25 | */ | |
| 26 | ||
| 27 | package org.jaudiotagger.tag.id3; | |
| 28 | ||
| 29 | import org.jaudiotagger.tag.TagException; | |
| 30 | ||
| 31 | import java.nio.ByteBuffer; | |
| 32 | import java.util.logging.Logger; | |
| 33 | ||
| 34 | ||
| 35 | /** | |
| 36 | * This specifies a series of methods that have to be implemented by all structural subclasses, | |
| 37 | * required to support all copy constructors,iterative methods and so on. | |
| 38 | * <p/> | |
| 39 | * TODO Not sure if this is really correct, if really needed should probably be an interface | |
| 40 | */ | |
| 41 | public abstract class AbstractTagItem | |
| 42 | { | |
| 43 | ||
| 44 | //Logger | |
| 45 | 74 | public static Logger logger = Logger.getLogger("org.jaudiotagger.tag.id3"); |
| 46 | ||
| 47 | ||
| 48 | public AbstractTagItem() | |
| 49 | 8817 | { |
| 50 | 8817 | } |
| 51 | ||
| 52 | public AbstractTagItem(AbstractTagItem copyObject) | |
| 53 | 0 | { |
| 54 | // no copy constructor in super class | |
| 55 | 0 | } |
| 56 | ||
| 57 | /** | |
| 58 | * ID string that usually corresponds to the class name, but can be | |
| 59 | * displayed to the user. It is not indended to identify each individual | |
| 60 | * instance. | |
| 61 | * | |
| 62 | * @return ID string | |
| 63 | */ | |
| 64 | abstract public String getIdentifier(); | |
| 65 | ||
| 66 | /** | |
| 67 | * Return size of this item | |
| 68 | * | |
| 69 | * @return size of this item | |
| 70 | */ | |
| 71 | abstract public int getSize(); | |
| 72 | ||
| 73 | /** | |
| 74 | * @param byteBuffer file to read from | |
| 75 | * @throws TagException on any exception generated by this library. | |
| 76 | */ | |
| 77 | abstract public void read(ByteBuffer byteBuffer) throws TagException; | |
| 78 | ||
| 79 | /** | |
| 80 | * Returns true if this datatype is a subset of the argument. This instance | |
| 81 | * is a subset if it is the same class as the argument. | |
| 82 | * | |
| 83 | * @param obj datatype to determine subset of | |
| 84 | * @return true if this instance and its entire datatype array list is a | |
| 85 | * subset of the argument. | |
| 86 | */ | |
| 87 | public boolean isSubsetOf(Object obj) | |
| 88 | { | |
| 89 | 0 | if ((obj instanceof AbstractTagItem) == false) |
| 90 | { | |
| 91 | 0 | return false; |
| 92 | } | |
| 93 | 0 | return true; |
| 94 | } | |
| 95 | ||
| 96 | /** | |
| 97 | * Returns true if this datatype and its body equals the argument and its | |
| 98 | * body. this datatype is equal if and only if they are the same class | |
| 99 | * | |
| 100 | * @param obj datatype to determine equality of | |
| 101 | * @return true if this datatype and its body are equal | |
| 102 | */ | |
| 103 | public boolean equals(Object obj) | |
| 104 | { | |
| 105 | 1 | return obj instanceof AbstractTagItem; |
| 106 | } | |
| 107 | } |