1 /* 2 * aTunes 3 * Copyright (C) Alex Aranda, Sylvain Gaudard and contributors 4 * 5 * See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors 6 * 7 * http://www.atunes.org 8 * http://sourceforge.net/projects/atunes 9 * 10 * This program is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU General Public License 12 * as published by the Free Software Foundation; either version 2 13 * of the License, or (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 */ 20 21 package net.sourceforge.atunes.kernel.modules.tags; 22 23 import java.io.File; 24 import java.util.HashMap; 25 import java.util.Map; 26 27 import javax.swing.table.TableCellEditor; 28 29 import net.sourceforge.atunes.model.ILocalAudioObject; 30 import net.sourceforge.atunes.model.ITag; 31 32 /** 33 * Keeps information about changes made in an attribute when importing 34 * 35 * @author fleax 36 */ 37 abstract class AbstractTagAttributeReviewed { 38 39 /** 40 * Name of this tag attribute 41 */ 42 private String name; 43 44 /** 45 * Keeps changes made in files of a given folder for this tag attribute 46 */ 47 private Map<File, String> changesMade = new HashMap<File, String>(); 48 AbstractTagAttributeReviewed(String name)49 AbstractTagAttributeReviewed(String name) { 50 this.name = name; 51 } 52 53 /** 54 * @return the name 55 */ getName()56 String getName() { 57 return name; 58 } 59 60 /** 61 * @return the changesMade 62 */ getChangesMade()63 Map<File, String> getChangesMade() { 64 return changesMade; 65 } 66 67 /** 68 * Returns TableCellEditor to be used to edit this tag attribute 69 * 70 * @return 71 */ getCellEditor()72 TableCellEditor getCellEditor() { 73 return null; 74 } 75 76 /** 77 * Returns a value of this tag attribute for the given AudioFile 78 * 79 * @param audioFile 80 * @return 81 */ getValue(ILocalAudioObject audioFile)82 abstract String getValue(ILocalAudioObject audioFile); 83 84 /** 85 * Modifies a Tag with the given value 86 * 87 * @param tag 88 * @param value 89 * @return 90 */ changeTag(ITag tag, String value)91 abstract ITag changeTag(ITag tag, String value); 92 93 } 94