| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Unpublished |
|
| 2.0;2 |
| 1 | package de.glossmaker.bib.datastructure; | |
| 2 | ||
| 3 | import de.glossmaker.gloss.datastructure.IItem; | |
| 4 | ||
| 5 | /** | |
| 6 | * <p>This class implements the BibTeX <code>UNPUBLISHED</code> item.</p> | |
| 7 | * Required fields: | |
| 8 | * <ul> | |
| 9 | * <li>author,</li> | |
| 10 | * <li>title,</li> | |
| 11 | * <li>note.</li> | |
| 12 | * </ul> | |
| 13 | * Optional fields: | |
| 14 | * <ul> | |
| 15 | * <li>month,</li> | |
| 16 | * <li>year.</li> | |
| 17 | * </ul> | |
| 18 | * | |
| 19 | * @author Markus Flingelli | |
| 20 | * | |
| 21 | */ | |
| 22 | public class Unpublished extends ABibItem { | |
| 23 | ||
| 24 | Unpublished(String key, EBibTeXReference reference) { | |
| 25 | 50 | super(key, reference); |
| 26 | 50 | } |
| 27 | ||
| 28 | public Unpublished(String key, String title, String author, String note) { | |
| 29 | 3 | super(key, EBibTeXReference.UNPUBLISHED); |
| 30 | 3 | setTitle(title); |
| 31 | 3 | setAuthor(author); |
| 32 | 3 | setNote(note); |
| 33 | 3 | } |
| 34 | ||
| 35 | ||
| 36 | @Override | |
| 37 | public boolean isItemValid() { | |
| 38 | 5 | boolean result = getKey() != null && getKey().length() > 0; |
| 39 | 5 | result &= getAuthor() != null && getAuthor().length() > 0; |
| 40 | 5 | result &= getTitle() != null && getTitle().length() > 0; |
| 41 | 5 | result &= getNote() != null && getNote().length() > 0; |
| 42 | 5 | return result; |
| 43 | } | |
| 44 | ||
| 45 | @Override | |
| 46 | public IItem cloneItem() { | |
| 47 | 1 | Unpublished clone = new Unpublished(getKey(), getTitle(), getAuthor(), getNote()); |
| 48 | 1 | clone.setItemValues(this); |
| 49 | 1 | return clone; |
| 50 | } | |
| 51 | } |