import javax.xml.bind.annotation.XmlType;
import org.apache.commons.lang3.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.envers.Audited;
@Override
public Set<Taxon> getCoveredTaxa() {
if (coveredTaxa == null) {
- this.coveredTaxa = new HashSet<Taxon>();
+ this.coveredTaxa = new HashSet<>();
}
return coveredTaxa;
}
@Override
public Set<NamedArea> getGeographicalScope() {
if (geographicalScope == null) {
- this.geographicalScope = new HashSet<NamedArea>();
+ this.geographicalScope = new HashSet<>();
}
return geographicalScope;
}
@Override
public Set<Taxon> getTaxonomicScope() {
if (taxonomicScope == null) {
- this.taxonomicScope = new HashSet<Taxon>();
+ this.taxonomicScope = new HashSet<>();
}
return taxonomicScope;
}
@Override
public Set<DefinedTerm> getScopeRestrictions() {
if (scopeRestrictions == null) {
- this.scopeRestrictions = new HashSet<DefinedTerm>();
+ this.scopeRestrictions = new HashSet<>();
}
return scopeRestrictions;
}
// ******************** toString *****************************************/
- private class IntegerObject {
- int number = 0;
-
- int inc() {
- return number++;
- };
-
- @Override
- public String toString() {
- return String.valueOf(number);
- }
- }
-
public String print(PrintStream stream) {
String title = this.getTitleCache() + "\n";
String strPrint = title;
}
- // *********************** CLONE ************************************/
+// *********************** CLONE ************************************/
/**
* Clones <i>this</i> PolytomousKey. This is a shortcut that enables to
try {
result = (PolytomousKey) super.clone();
- result.coveredTaxa = new HashSet<Taxon>();
+ result.coveredTaxa = new HashSet<>();
for (Taxon taxon : this.coveredTaxa) {
result.addCoveredTaxon(taxon);
}
- result.geographicalScope = new HashSet<NamedArea>();
+ result.geographicalScope = new HashSet<>();
for (NamedArea area : this.geographicalScope) {
result.addGeographicalScope(area);
}
result.root = this.root.clone();
- result.scopeRestrictions = new HashSet<DefinedTerm>();
+ result.scopeRestrictions = new HashSet<>();
for (DefinedTerm scope : this.scopeRestrictions) {
result.addScopeRestriction(scope);
}
- result.taxonomicScope = new HashSet<Taxon>();
+ result.taxonomicScope = new HashSet<>();
for (Taxon taxon : this.taxonomicScope) {
result.addTaxonomicScope(taxon);
}
return null;
}
}
-}
+}
\ No newline at end of file
//do nothing
}
- /**
- * @return
- */
+
public PolytomousKey getKey() {
return key;
}
-
- /**
- * @param key
- */
public void setKey(PolytomousKey key) {
this.key = key;
}
* node. If the list does not contain this node then -1 will be returned.
*
* @param node
- * the feature node the position of which is being searched
+ * the polytomous key node the position of which is searched
* @see #addChild(PolytomousKeyNode, int)
* @see #removeChild(int)
*/
}
/**
- * Returns the boolean value indicating if <i>this</i> feature node has
+ * Returns the boolean value indicating if <i>this</i> polytomous key node has
* children (false) or not (true). A node without children is at the
* bottommost level of a tree and is called a leaf.
*
}
}
+ public Taxon removeTaxon() {
+ Taxon result = taxon;
+ this.taxon = null;
+ return result;
+ }
+
private boolean emptyChildNodeExists() {
for (PolytomousKeyNode child : this.children){
if (child.getStatement() == null && child.getQuestion() == null && child.getChildren().isEmpty()
PolytomousKeyNode result;
try {
result = (PolytomousKeyNode) super.clone();
- result.children = new ArrayList<PolytomousKeyNode>();
+ result.children = new ArrayList<>();
- result.modifyingText = new HashMap<Language, LanguageString>();
+ result.modifyingText = new HashMap<>();
for (Entry<Language, LanguageString> entry : this.modifyingText
.entrySet()) {
result.putModifyingText(entry.getValue());
}
}
- public Taxon removeTaxon() {
- Taxon result = taxon;
- this.taxon = null;
- return result;
- }
-
}
\ No newline at end of file