| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| StringDateTime |
|
| 1.8;1.8 |
| 1 | /** | |
| 2 | * @author : Paul Taylor | |
| 3 | * @author : Eric Farng | |
| 4 | * | |
| 5 | * Version @version:$Id: StringDateTime.java 836 2009-11-12 15:44:07Z paultaylor $ | |
| 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 | * | |
| 23 | */ | |
| 24 | package org.jaudiotagger.tag.datatype; | |
| 25 | ||
| 26 | import org.jaudiotagger.tag.id3.AbstractTagFrameBody; | |
| 27 | ||
| 28 | ||
| 29 | /** | |
| 30 | * Represents a timestamp field | |
| 31 | */ | |
| 32 | public class StringDateTime extends StringSizeTerminated | |
| 33 | { | |
| 34 | /** | |
| 35 | * Creates a new ObjectStringDateTime datatype. | |
| 36 | * | |
| 37 | * @param identifier | |
| 38 | * @param frameBody | |
| 39 | */ | |
| 40 | public StringDateTime(String identifier, AbstractTagFrameBody frameBody) | |
| 41 | { | |
| 42 | 0 | super(identifier, frameBody); |
| 43 | 0 | } |
| 44 | ||
| 45 | public StringDateTime(StringDateTime object) | |
| 46 | { | |
| 47 | 0 | super(object); |
| 48 | 0 | } |
| 49 | ||
| 50 | /** | |
| 51 | * @param value | |
| 52 | */ | |
| 53 | public void setValue(Object value) | |
| 54 | { | |
| 55 | 0 | if (value != null) |
| 56 | { | |
| 57 | 0 | this.value = value.toString().replace(' ', 'T'); |
| 58 | } | |
| 59 | 0 | } |
| 60 | ||
| 61 | /** | |
| 62 | * @return | |
| 63 | */ | |
| 64 | public Object getValue() | |
| 65 | { | |
| 66 | 0 | if (value != null) |
| 67 | { | |
| 68 | 0 | return value.toString().replace(' ', 'T'); |
| 69 | } | |
| 70 | else | |
| 71 | { | |
| 72 | 0 | return null; |
| 73 | } | |
| 74 | } | |
| 75 | ||
| 76 | public boolean equals(Object obj) | |
| 77 | { | |
| 78 | 0 | return obj instanceof StringDateTime && super.equals(obj); |
| 79 | ||
| 80 | } | |
| 81 | } |