| 1 | |
package de.glossmaker.bib.datastructure; |
| 2 | |
|
| 3 | |
import de.glossmaker.gloss.datastructure.IItem; |
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
public class Article extends ABibItem { |
| 27 | |
|
| 28 | |
Article(String key, EBibTeXReference reference) { |
| 29 | 50 | super(key, reference); |
| 30 | 50 | } |
| 31 | |
|
| 32 | |
public Article(String key, String title, String author, String journal, String year) { |
| 33 | 62 | super(key, EBibTeXReference.ARTICLE); |
| 34 | 62 | setAuthor(author); |
| 35 | 62 | setTitle(title); |
| 36 | 62 | setJournal(journal); |
| 37 | 62 | setYear(year); |
| 38 | 62 | } |
| 39 | |
|
| 40 | |
|
| 41 | |
@Override |
| 42 | |
public boolean isItemValid() { |
| 43 | 6 | boolean result = getKey() != null && getKey().length() > 0; |
| 44 | 6 | result &= getAuthor() != null && getAuthor().length() > 0; |
| 45 | 6 | result &= getTitle() != null && getTitle().length() > 0; |
| 46 | 6 | result &= getJournal() != null && getJournal().length() > 0; |
| 47 | 6 | result &= getYear() != null; |
| 48 | |
|
| 49 | 6 | return result; |
| 50 | |
} |
| 51 | |
|
| 52 | |
|
| 53 | |
@Override |
| 54 | |
public IItem cloneItem() { |
| 55 | 2 | Article clone = new Article(getKey(), getTitle(), getAuthor(), getJournal(), getYear()); |
| 56 | 2 | clone.setItemValues(this); |
| 57 | 2 | return clone; |
| 58 | |
} |
| 59 | |
} |