| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AbstractJTFileHeader |
|
| 1.0;1 |
| 1 | package org.jtheque.core.utils.file.jt; | |
| 2 | ||
| 3 | /* | |
| 4 | * This file is part of JTheque. | |
| 5 | * | |
| 6 | * JTheque is free software: you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation, either version 3 of the License. | |
| 9 | * | |
| 10 | * JTheque is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | */ | |
| 18 | ||
| 19 | import org.jtheque.utils.bean.Version; | |
| 20 | ||
| 21 | /** | |
| 22 | * An header for a JTheque File. | |
| 23 | * | |
| 24 | * @author Baptiste Wicht | |
| 25 | */ | |
| 26 | 0 | public abstract class AbstractJTFileHeader { |
| 27 | private String key; | |
| 28 | private Version versionJTheque; | |
| 29 | private int fileVersion; | |
| 30 | private int date; | |
| 31 | ||
| 32 | /** | |
| 33 | * Return the hash key. | |
| 34 | * | |
| 35 | * @return The hash key. | |
| 36 | */ | |
| 37 | protected final CharSequence getKey() { | |
| 38 | 0 | return key; |
| 39 | } | |
| 40 | ||
| 41 | /** | |
| 42 | * Set the hash key. | |
| 43 | * | |
| 44 | * @param key The hash key. | |
| 45 | */ | |
| 46 | public final void setKey(String key) { | |
| 47 | 0 | this.key = key; |
| 48 | 0 | } |
| 49 | ||
| 50 | /** | |
| 51 | * Set the JTheque Version. | |
| 52 | * | |
| 53 | * @param version The version of JTheque. | |
| 54 | */ | |
| 55 | public final void setVersionJTheque(Version version) { | |
| 56 | 0 | versionJTheque = version; |
| 57 | 0 | } |
| 58 | ||
| 59 | /** | |
| 60 | * Return the version of JTheque. | |
| 61 | * | |
| 62 | * @return The version of JTheque. | |
| 63 | */ | |
| 64 | protected final Version getVersionJTheque() { | |
| 65 | 0 | return versionJTheque; |
| 66 | } | |
| 67 | ||
| 68 | /** | |
| 69 | * Set the date of the file. | |
| 70 | * | |
| 71 | * @param date The date of the file. | |
| 72 | */ | |
| 73 | public final void setDate(int date) { | |
| 74 | 0 | this.date = date; |
| 75 | 0 | } |
| 76 | ||
| 77 | /** | |
| 78 | * Return the date of the file. | |
| 79 | * | |
| 80 | * @return The date of the file. | |
| 81 | */ | |
| 82 | public final int getDate() { | |
| 83 | 0 | return date; |
| 84 | } | |
| 85 | ||
| 86 | /** | |
| 87 | * Return the version of the file. | |
| 88 | * | |
| 89 | * @return The version of the file. | |
| 90 | */ | |
| 91 | public final int getFileVersion() { | |
| 92 | 0 | return fileVersion; |
| 93 | } | |
| 94 | ||
| 95 | /** | |
| 96 | * Set the file version. | |
| 97 | * | |
| 98 | * @param fileVersion The version of the file. | |
| 99 | */ | |
| 100 | public final void setFileVersion(int fileVersion) { | |
| 101 | 0 | this.fileVersion = fileVersion; |
| 102 | 0 | } |
| 103 | ||
| 104 | /** | |
| 105 | * Indicate if the file is complete or not. | |
| 106 | * | |
| 107 | * @return true if the file is complete else false. | |
| 108 | */ | |
| 109 | public abstract boolean isComplete(); | |
| 110 | } |