Coverage Report - org.jaudiotagger.tag.lyrics3.Lyrics3v2Fields
 
Classes in this File Line Coverage Branch Coverage Complexity
Lyrics3v2Fields
84%
16/19
50%
2/4
2
 
 1  
 /**
 2  
  * @author : Paul Taylor
 3  
  * <p/>
 4  
  * Version @version:$Id: Lyrics3v2Fields.java,v 1.4 2008/01/01 15:14:24 paultaylor Exp $
 5  
  * <p/>
 6  
  * Jaudiotagger Copyright (C)2004,2005
 7  
  * <p/>
 8  
  * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
 9  
  * General Public  License as published by the Free Software Foundation; either version 2.1 of the License,
 10  
  * or (at your option) any later version.
 11  
  * <p/>
 12  
  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 13  
  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 14  
  * See the GNU Lesser General Public License for more details.
 15  
  * <p/>
 16  
  * You should have received a copy of the GNU Lesser General Public License along with this library; if not,
 17  
  * you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software
 18  
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 19  
  * <p/>
 20  
  * Description:
 21  
  */
 22  
 package org.jaudiotagger.tag.lyrics3;
 23  
 
 24  
 import org.jaudiotagger.tag.datatype.AbstractStringStringValuePair;
 25  
 
 26  
 public class Lyrics3v2Fields extends AbstractStringStringValuePair
 27  
 {
 28  
 
 29  
     private static Lyrics3v2Fields lyrics3Fields;
 30  
 
 31  
     /**
 32  
      * CRLF int set
 33  
      */
 34  42
     private static final byte[] crlfByte = {13, 10};
 35  
     /**
 36  
      * CRLF int set
 37  
      */
 38  42
     public static final String CRLF = new String(crlfByte);
 39  
 
 40  
     public static Lyrics3v2Fields getInstanceOf()
 41  
     {
 42  126
         if (lyrics3Fields == null)
 43  
         {
 44  42
             lyrics3Fields = new Lyrics3v2Fields();
 45  
         }
 46  126
         return lyrics3Fields;
 47  
     }
 48  
 
 49  
     public static final String FIELD_V2_INDICATIONS = "IND";
 50  
     public static final String FIELD_V2_LYRICS_MULTI_LINE_TEXT = "LYR";
 51  
     public static final String FIELD_V2_ADDITIONAL_MULTI_LINE_TEXT = "INF";
 52  
     public static final String FIELD_V2_AUTHOR = "AUT";
 53  
     public static final String FIELD_V2_ALBUM = "EAL";
 54  
     public static final String FIELD_V2_ARTIST = "EAR";
 55  
     public static final String FIELD_V2_TRACK = "ETT";
 56  
     public static final String FIELD_V2_IMAGE = "IMG";
 57  
 
 58  
 
 59  
     private Lyrics3v2Fields()
 60  42
     {
 61  42
         idToValue.put(FIELD_V2_INDICATIONS, "Indications field");
 62  42
         idToValue.put(FIELD_V2_LYRICS_MULTI_LINE_TEXT, "Lyrics multi line text");
 63  42
         idToValue.put(FIELD_V2_ADDITIONAL_MULTI_LINE_TEXT, "Additional information multi line text");
 64  42
         idToValue.put(FIELD_V2_AUTHOR, "Lyrics/Music Author name");
 65  42
         idToValue.put(FIELD_V2_ALBUM, "Extended Album name");
 66  42
         idToValue.put(FIELD_V2_ARTIST, "Extended Artist name");
 67  42
         idToValue.put(FIELD_V2_TRACK, "Extended Track Title");
 68  42
         idToValue.put(FIELD_V2_IMAGE, "Link to an image files");
 69  42
         createMaps();
 70  42
     }
 71  
 
 72  
     /**
 73  
      * Returns true if the identifier is a valid Lyrics3v2 frame identifier
 74  
      *
 75  
      * @param identifier string to test
 76  
      * @return true if the identifier is a valid Lyrics3v2 frame identifier
 77  
      */
 78  
     public static boolean isLyrics3v2FieldIdentifier(String identifier)
 79  
     {
 80  0
         if (identifier.length() < 3)
 81  
         {
 82  0
             return false;
 83  
         }
 84  0
         return getInstanceOf().getIdToValueMap().containsKey(identifier.substring(0, 3));
 85  
     }
 86  
 }