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 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
public class InCollection extends ABibItem { |
33 | |
|
34 | |
InCollection(String key, EBibTeXReference reference) { |
35 | 50 | super(key, reference); |
36 | 50 | } |
37 | |
|
38 | |
public InCollection(String key, String title, String author, String booktitle, String publisher, String year) { |
39 | 3 | super(key, EBibTeXReference.INCOLLECTION); |
40 | 3 | setTitle(title); |
41 | 3 | setAuthor(author); |
42 | 3 | setBookTitle(booktitle); |
43 | 3 | setPublisher(publisher); |
44 | 3 | setYear(year); |
45 | 3 | } |
46 | |
|
47 | |
|
48 | |
@Override |
49 | |
public boolean isItemValid() { |
50 | 6 | boolean result = getKey() != null && getKey().length() > 0; |
51 | 6 | result &= getAuthor() != null && getAuthor().length() > 0; |
52 | 6 | result &= getBookTitle() != null && getBookTitle().length() > 0; |
53 | 6 | result &= getPublisher() != null && getPublisher().length() > 0; |
54 | 6 | result &= getYear() != null; |
55 | 6 | return result; |
56 | |
} |
57 | |
|
58 | |
@Override |
59 | |
public IItem cloneItem() { |
60 | 1 | InCollection clone = new InCollection(getKey(), getTitle(), getAuthor(), getBookTitle(), getPublisher(), getYear()); |
61 | 1 | clone.setItemValues(this); |
62 | 1 | return clone; |
63 | |
} |
64 | |
} |