Coverage Report - de.glossmaker.bib.datastructure.ACommonConference
 
Classes in this File Line Coverage Branch Coverage Complexity
ACommonConference
100%
41/41
63%
24/38
4,5
 
 1  
 package de.glossmaker.bib.datastructure;
 2  
 
 3  
 /**
 4  
  * The entries CONFERENCE and INPROCEEDINGS have the same fields.
 5  
  * 
 6  
  * @author Markus Flingelli
 7  
  *
 8  
  */
 9  
 abstract class ACommonConference extends ABibItem {
 10  
 
 11  
         ACommonConference(String key, EBibTeXReference reference) {
 12  100
                 super(key, reference);
 13  100
         }
 14  
         
 15  
         public ACommonConference(String key, EBibTeXReference reference, String title, String author, String bookTitle, String year) {
 16  5
                 super(key, reference);
 17  5
                 setTitle(title);
 18  5
                 setAuthor(author);
 19  5
                 setBookTitle(bookTitle);
 20  5
                 setYear(year);
 21  5
         }
 22  
         
 23  
         public String toString() {
 24  50
                 String result = "@" + getReference() + "{" + getKey() + "," + System.getProperty("line.separator");
 25  50
                 result += "  author = {" + getAuthor() + "}," + System.getProperty("line.separator");
 26  50
                 result += "  title = {" + getTitle() + "}," + System.getProperty("line.separator");
 27  50
                 result += "  booktitle = {" + getBookTitle() + "}," + System.getProperty("line.separator");
 28  50
                 result += "  year = {" + getYear() + "}," + System.getProperty("line.separator");
 29  50
                 if (getEditor() != null) {
 30  50
                         result += "  editor = {" + getEditor() + "}," + System.getProperty("line.separator");
 31  
                 }
 32  50
                 if (getVolume() != null) {
 33  50
                         result += "  volume = {" + getVolume() + "}," + System.getProperty("line.separator");
 34  
                 }
 35  50
                 if (getNumber() != null) {
 36  50
                         result += "  number = {" + getNumber() + "}," + System.getProperty("line.separator");
 37  
                 }
 38  50
                 if (getSeries() != null) {
 39  50
                         result += "  series = {" + getSeries() + "}," + System.getProperty("line.separator");
 40  
                 }
 41  50
                 if (getPages() != null) {
 42  50
                         result += "  pages = {" + getPages() + "}," + System.getProperty("line.separator");
 43  
                 }
 44  50
                 if (getAddress() != null) {
 45  50
                         result += "  address= {" + getAddress() + "}," + System.getProperty("line.separator");
 46  
                 }
 47  50
                 if (getMonth() != null) {
 48  50
                         result += "  month = {" + getMonth() + "}," + System.getProperty("line.separator");
 49  
                 }
 50  50
                 if (getOrganization() != null) {
 51  50
                         result += "  organization = {" + getOrganization() + "}," + System.getProperty("line.separator");
 52  
                 }
 53  50
                 if (getPublisher() != null) {
 54  50
                         result += "  publisher = {" + getPublisher() + "}," + System.getProperty("line.separator");
 55  
                 }
 56  50
                 if (getNote() != null) {
 57  50
                         result += "  note = {" + getNote() + "}," + System.getProperty("line.separator");
 58  
                 }
 59  50
                 result += "}";
 60  50
                 return result;
 61  
         }
 62  
         
 63  
         @Override
 64  
         public boolean isItemValid() {
 65  6
                 boolean result = getKey() != null && getKey().length() > 0;
 66  6
                 result &= getAuthor() != null && getAuthor().length() > 0;
 67  6
                 result &= getTitle() != null && getTitle().length() > 0;
 68  6
                 result &= getBookTitle() != null && getBookTitle().length() > 0;
 69  6
                 result &= getYear() != null;
 70  6
                 return result;
 71  
         }
 72  
 }