| 1 | package org.farng.mp3.object; |
| 2 | |
| 3 | import org.farng.mp3.TagUtility; |
| 4 | |
| 5 | /** |
| 6 | * ID3v2 and Lyrics3v2 tags have individual fields <code>AbstractMP3Fragment</code>s Then each fragment is broken down |
| 7 | * in to individual <code>AbstractMP3Object</code>s |
| 8 | * |
| 9 | * @author Eric Farng |
| 10 | * @version $Revision: 1.4 $ |
| 11 | */ |
| 12 | public class ObjectStringDate extends ObjectStringFixedLength { |
| 13 | |
| 14 | /** |
| 15 | * Creates a new ObjectStringDate object. |
| 16 | */ |
| 17 | public ObjectStringDate(final String identifier) { |
| 18 | super(identifier, 8); |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * Creates a new ObjectStringDate object. |
| 23 | */ |
| 24 | public ObjectStringDate(final ObjectStringDate object) { |
| 25 | super(object); |
| 26 | } |
| 27 | |
| 28 | public void setValue(final Object value) { |
| 29 | if (value != null) { |
| 30 | this.value = TagUtility.stripChar(value.toString(), '-'); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | public Object getValue() { |
| 35 | if (this.value != null) { |
| 36 | return TagUtility.stripChar(this.value.toString(), '-'); |
| 37 | } |
| 38 | return null; |
| 39 | } |
| 40 | |
| 41 | public boolean equals(final Object obj) { |
| 42 | if (obj instanceof ObjectStringDate == false) { |
| 43 | return false; |
| 44 | } |
| 45 | return super.equals(obj); |
| 46 | } |
| 47 | } |