Revision 4b8da4a0
Added by Andreas Müller over 1 year ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PolytomousKeyNode.java | ||
---|---|---|
303 | 303 |
//do nothing |
304 | 304 |
} |
305 | 305 |
|
306 |
/** |
|
307 |
* @return |
|
308 |
*/ |
|
306 |
|
|
309 | 307 |
public PolytomousKey getKey() { |
310 | 308 |
return key; |
311 | 309 |
} |
312 |
|
|
313 |
/** |
|
314 |
* @param key |
|
315 |
*/ |
|
316 | 310 |
public void setKey(PolytomousKey key) { |
317 | 311 |
this.key = key; |
318 | 312 |
} |
... | ... | |
627 | 621 |
* node. If the list does not contain this node then -1 will be returned. |
628 | 622 |
* |
629 | 623 |
* @param node |
630 |
* the feature node the position of which is being searched
|
|
624 |
* the polytomous key node the position of which is searched
|
|
631 | 625 |
* @see #addChild(PolytomousKeyNode, int) |
632 | 626 |
* @see #removeChild(int) |
633 | 627 |
*/ |
... | ... | |
640 | 634 |
} |
641 | 635 |
|
642 | 636 |
/** |
643 |
* Returns the boolean value indicating if <i>this</i> feature node has
|
|
637 |
* Returns the boolean value indicating if <i>this</i> polytomous key node has
|
|
644 | 638 |
* children (false) or not (true). A node without children is at the |
645 | 639 |
* bottommost level of a tree and is called a leaf. |
646 | 640 |
* |
... | ... | |
831 | 825 |
} |
832 | 826 |
} |
833 | 827 |
|
828 |
public Taxon removeTaxon() { |
|
829 |
Taxon result = taxon; |
|
830 |
this.taxon = null; |
|
831 |
return result; |
|
832 |
} |
|
833 |
|
|
834 | 834 |
private boolean emptyChildNodeExists() { |
835 | 835 |
for (PolytomousKeyNode child : this.children){ |
836 | 836 |
if (child.getStatement() == null && child.getQuestion() == null && child.getChildren().isEmpty() |
... | ... | |
858 | 858 |
PolytomousKeyNode result; |
859 | 859 |
try { |
860 | 860 |
result = (PolytomousKeyNode) super.clone(); |
861 |
result.children = new ArrayList<PolytomousKeyNode>();
|
|
861 |
result.children = new ArrayList<>(); |
|
862 | 862 |
|
863 |
result.modifyingText = new HashMap<Language, LanguageString>();
|
|
863 |
result.modifyingText = new HashMap<>(); |
|
864 | 864 |
for (Entry<Language, LanguageString> entry : this.modifyingText |
865 | 865 |
.entrySet()) { |
866 | 866 |
result.putModifyingText(entry.getValue()); |
... | ... | |
874 | 874 |
} |
875 | 875 |
} |
876 | 876 |
|
877 |
public Taxon removeTaxon() { |
|
878 |
Taxon result = taxon; |
|
879 |
this.taxon = null; |
|
880 |
return result; |
|
881 |
} |
|
882 |
|
|
883 | 877 |
} |
Also available in: Unified diff
cleanup