Coverage Report - de.glossmaker.bib.datastructure.Article
 
Classes in this File Line Coverage Branch Coverage Complexity
Article
100%
17/17
72%
13/18
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>ARTICLE</code> item.</p>
 7  
  * Required fields:
 8  
  * <ul>
 9  
  *   <li>author,</li>
 10  
  *   <li>title,</li>
 11  
  *   <li>journal,</li>
 12  
  *   <li>year.</li>
 13  
  *  </ul>
 14  
  *  Optional fields:
 15  
  *  <ul>
 16  
  *    <li>volume,</li>
 17  
  *    <li>number,</li>
 18  
  *    <li>pages,</li>
 19  
  *    <li>month,</li>
 20  
  *    <li>note.</li>
 21  
  *  </ul>
 22  
  *  
 23  
  * @author Markus Flingelli
 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  
 }