FileDocCategorySizeDatePackage
MusicMetadata.javaAPI DocMyID3 for Android9855Wed Oct 08 18:11:02 BST 2008org.cmc.music.metadata

MusicMetadata

public class MusicMetadata extends SimpleMap implements IMusicMetadata, MusicMetadataConstants
A collection of metadata values, possibly read from a single tag (ie. ID3v1 or ID3v2)
see
org.cmc.music.myid3.metadata.MusicMetadataSet

Fields Summary
public final String
name
Constructors Summary
public MusicMetadata(String name)

		this.name = name;
	
public MusicMetadata(MusicMetadata other)

		this.name = other.name;
		putAll(other);
	
Methods Summary
public voidaddPicture(org.cmc.music.metadata.ImageData image)

		Vector v = getVector(KEY_PICTURES);
		if (null == v)
			v = new Vector();
		v.add(image);
		put(KEY_PICTURES, v);
	
public voidclearAlbum()

		remove(KEY_ALBUM);
	
public voidclearArtist()

		remove(KEY_ARTIST);
	
public voidclearComment()

		remove(KEY_COMMENT);
	
public voidclearCompilation()

		remove(KEY_COMPILATION);
	
public voidclearComposer()

		remove(KEY_COMPOSER);
	
public voidclearComposer2()

		remove(KEY_COMPOSER_2);
	
public voidclearDurationSeconds()

		remove(KEY_DURATION_SECONDS);
	
public voidclearFeaturingList()

		remove(KEY_FEATURING_LIST);
	
public voidclearGenre()

		remove(KEY_GENRE);
	
public voidclearPictureList()

		remove(KEY_PICTURES);
	
public voidclearProducer()

		remove(KEY_PRODUCER);
	
public voidclearProducerArtist()

		remove(KEY_ALBUM_ARTIST);
	
public voidclearSongTitle()

		remove(KEY_TITLE);
	
public voidclearTrackNumber()

		remove(KEY_TRACK_NUMBER);
	
public voidclearYear()

		remove(KEY_YEAR);
	
public static final org.cmc.music.metadata.MusicMetadatacreateEmptyMetadata()

		return new MusicMetadata("New Metadata");
	
public java.lang.StringgetAlbum()

		return getString(KEY_ALBUM);
	
public java.lang.StringgetArtist()

		return getString(KEY_ARTIST);
	
public java.lang.StringgetComment()

		return getString(KEY_COMMENT);
	
public java.lang.StringgetCompilation()

		return getString(KEY_COMPILATION);
	
public java.lang.StringgetComposer()

		return getString(KEY_COMPOSER);
	
public java.lang.StringgetComposer2()

		return getString(KEY_COMPOSER_2);
	
public java.lang.StringgetDurationSeconds()

		return getString(KEY_DURATION_SECONDS);
	
public java.util.VectorgetFeaturingList()

		return getVector(KEY_FEATURING_LIST);
	
public java.lang.StringgetGenre()

		return getString(KEY_GENRE);
	
private java.lang.NumbergetNumber(java.lang.Object key)

		Object result = get(key);
		if (result == null)
			return null;


		return (Number) result;
	
public java.util.VectorgetPictureList()

		Vector result = getVector(KEY_PICTURES);
		if (result == null)
			result = new Vector();
		return result;
	
public java.lang.StringgetProducer()

		return getString(KEY_PRODUCER);
	
public java.lang.StringgetProducerArtist()

		return getString(KEY_ALBUM_ARTIST);
	
public java.lang.StringgetSongTitle()

		return getString(KEY_TITLE);
	
private java.lang.StringgetString(java.lang.Object key)

		Object result = get(key);
		if (result == null)
			return null;


		return (String) result;
	
public java.lang.NumbergetTrackNumber()

		return getNumber(KEY_TRACK_NUMBER);
	
private java.util.VectorgetVector(java.lang.Object key)

		Object result = get(key);
		if (result == null)
			return null;


		return (Vector) result;
	
public java.lang.StringgetYear()

		return getString(KEY_YEAR);
	
public booleanhasBasicInfo()

		if (null == getArtist())
			return false;
		if (null == getSongTitle())
			return false;
		if (null == getAlbum())
			return false;
		if (null == getTrackNumber())
			return false;

		return true;
	
public voidsetAlbum(java.lang.String s)

		put(KEY_ALBUM, s);
	
public voidsetArtist(java.lang.String s)

		put(KEY_ARTIST, s);
	
public voidsetComment(java.lang.String s)

		put(KEY_COMMENT, s);
	
public voidsetCompilation(java.lang.String s)

		put(KEY_COMPILATION, s);
	
public voidsetComposer(java.lang.String s)

		put(KEY_COMPOSER, s);
	
public voidsetComposer2(java.lang.String s)

		put(KEY_COMPOSER_2, s);
	
public voidsetDurationSeconds(java.lang.String s)

		put(KEY_DURATION_SECONDS, s);
	
public voidsetFeaturingList(java.util.Vector v)

		put(KEY_FEATURING_LIST, v);
	
public voidsetGenre(java.lang.String s)

		put(KEY_GENRE, s);
	
public voidsetPictureList(java.util.Vector v)

		put(KEY_PICTURES, v);
	
public voidsetProducer(java.lang.String s)

		put(KEY_PRODUCER, s);
	
public voidsetProducerArtist(java.lang.String s)

		put(KEY_ALBUM_ARTIST, s);
	
public voidsetSongTitle(java.lang.String s)

		put(KEY_TITLE, s);
	
public voidsetTrackNumber(java.lang.Number s)

		put(KEY_TRACK_NUMBER, s);
	
public voidsetYear(java.lang.String s)

		put(KEY_YEAR, s);
	
public java.lang.StringtoString()

		StringBuffer result = new StringBuffer();

		result.append("{ ");

		Vector keys = new Vector(keySet());
		Collections.sort(keys);
		for (int i = 0; i < keys.size(); i++)
		{
			Object key = keys.get(i);
			Object value = get(key);

			if (i > 0)
				result.append(", ");
			result.append(key + ": " + value);
		}

		result.append(" }");

		return result.toString();