/**\r
* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
* http://www.e-taxonomy.eu\r
-* \r
+*\r
* The contents of this file are subject to the Mozilla Public License Version 1.1\r
* See LICENSE.TXT at the top of this package for the full license terms.\r
*/\r
-\r
package eu.etaxonomy.cdm.common;\r
\r
import org.apache.log4j.Logger;\r
\r
/**\r
* An instance of this class represents an method result that contains 2 variables. The variables may be typified.\r
+ *\r
* @author a.mueller\r
* @since 30.10.2008\r
- * @version 1.0\r
*/\r
public class DoubleResult<S extends Object, T extends Object> {\r
private static final Logger logger = Logger.getLogger(DoubleResult.class);\r
- \r
+\r
private S firstResult = null;\r
private T secondResult = null;\r
- \r
+\r
public DoubleResult() {\r
if (logger.isDebugEnabled()){logger.debug("Constructor");}\r
}\r
\r
- \r
+\r
public DoubleResult(S firstResult, T secondResult) {\r
this.firstResult = firstResult;\r
this.secondResult = secondResult;\r
}\r
\r
- /**\r
- * @return the firstResult\r
- */\r
public S getFirstResult() {\r
return firstResult;\r
}\r
-\r
- /**\r
- * @param firstResult the firstResult to set\r
- */\r
public void setFirstResult(S firstResult) {\r
this.firstResult = firstResult;\r
}\r
\r
- /**\r
- * @return the secondResult\r
- */\r
public T getSecondResult() {\r
return secondResult;\r
}\r
-\r
- /**\r
- * @param secondResult the secondResult to set\r
- */\r
public void setSecondResult(T secondResult) {\r
this.secondResult = secondResult;\r
}\r
- \r
-}\r
+}
\ No newline at end of file
}
}
if(state.getConfig().isCreateCondensedDistributionString()){
- List<Language> langs = new ArrayList<Language>();
+ List<Language> langs = new ArrayList<>();
langs.add(Language.ENGLISH());
CondensedDistribution conDis =
geoService.getCondensedDistribution(distributions, true,
- null,null,state.getConfig().getCondensedDistributionRecipe(), langs
- );
+ null,null,state.getConfig().getCondensedDistributionRecipe(), langs);
CdmLightExportTable tableCondensed =
- CdmLightExportTable.CONDENSED_DISTRIBUTION_FACT;
+ CdmLightExportTable.CONDENSED_DISTRIBUTION_FACT;
String[] csvLine = new String[table.getSize()];
csvLine[tableCondensed.getIndex(CdmLightExportTable.TAXON_FK)] =
- getId(state, taxon);
+ getId(state, taxon);
csvLine[tableCondensed.getIndex(CdmLightExportTable.FACT_TEXT)] =
- conDis.toString();
+ conDis.toString();
state.getProcessor().put(tableCondensed, taxon, csvLine);
}
-
}
private void handleCommonNameFacts(CdmLightExportState state, Taxon taxon,
public static final UUID uuidIntroduced = UUID.fromString("643cf9d1-a5f1-4622-9837-82ef961e880b");
private static final UUID uuidIntroducedDoubtfullyIntroduced = UUID.fromString("0c54761e-4887-4788-9dfa-7190c88746e3");
public static final UUID uuidIntroducedUncertainDegreeNaturalisation = UUID.fromString("da159544-b0dd-4599-a9c9-640826af8c17");
- public static final UUID uuidIntroducesAdventitious = UUID.fromString("42946bd6-9c22-45ad-a910-7427e8f60bfd");
+ public static final UUID uuidIntroducedAdventitious = UUID.fromString("42946bd6-9c22-45ad-a910-7427e8f60bfd");
public static final UUID uuidNaturalised = UUID.fromString("e191e89a-a751-4b0c-b883-7f1de70915c9");
private static final UUID uuidIntroducedCultiated = UUID.fromString("fac8c347-8262-44a1-b0a4-db4de451c021");
private static final UUID uuidEndemic = UUID.fromString("c3ee7048-15b7-4be1-b687-9ce9c1a669d6");
* @see #INTRODUCED_ADVENTITIOUS()
*/
public static final PresenceAbsenceTerm CASUAL(){
- return getTermByUuid(uuidIntroducesAdventitious);
+ return getTermByUuid(uuidIntroducedAdventitious);
}
/**
* Casual alien, presence questionable
*/
@Deprecated
public static final PresenceAbsenceTerm INTRODUCED_ADVENTITIOUS(){
- return getTermByUuid(uuidIntroducesAdventitious);
+ return getTermByUuid(uuidIntroducedAdventitious);
}
public static final PresenceAbsenceTerm INTRODUCED_CULTIVATED(){
public boolean isNomStatus(){
return this == nomStatus;
}
+ /**
+ * @return <code>true</code> if type is separator or postSeparator
+ */
public boolean isSeparator(){
return this == separator || this == postSeparator;
}
* @return the concatenated string
* @see #createString(List, HTMLTagRules)
*/
- public static String createString(List<TaggedText> tags) {
+ public static String createString(List<? extends TaggedText> tags) {
StringBuilder result = new StringBuilder();
boolean isSeparator;
//create String
StringBuffer result = new StringBuffer();
- Stack<String> htmlStack = new Stack<String>();
+ Stack<String> htmlStack = new Stack<>();
for (int i = 0; i < tags.size(); i++ ){
TaggedText tag = tags.get(i);
TagEnum thisType = tag.getType();
TagEnum nextType = (i + 1 >= tags.size() ? null : tags.get(i + 1).getType());
boolean isSeparator = tag.getType().isSeparator();
-// boolean lastEqual = tag.getType().equals(lastType);
-// boolean nextEqual = tag.getType().equals(nextType);
-// boolean bothEqual = lastEqual && nextEqual;
//compute list of rules (tags)
SortedSet<String> separatorRules;
}
return result;
}
-}
+}
\ No newline at end of file
import eu.etaxonomy.cdm.ref.TypedEntityReference;
/**
- *
* @author a.kohlbecker
* @author m.doering
* @since 11.12.2007
Set<MarkerType> hiddenAreaMarkerTypes, boolean preferAggregated, boolean statusOrderPreference,
boolean subAreaPreference) {
- SetMap<NamedArea, Distribution> filteredDistributions = new SetMap<>(100); // start with a big map from the beginning!
+ SetMap<NamedArea, Distribution> filteredDistributions = new SetMap<>(distributions.size());
// sort Distributions by the area
for(Distribution distribution : distributions){
private static void handleHiddenAndFallbackAreas(Set<MarkerType> hiddenAreaMarkerTypes,
SetMap<NamedArea, Distribution> filteredDistributions) {
+
Set<NamedArea> areasHiddenByMarker = new HashSet<>();
for(NamedArea area : filteredDistributions.keySet()) {
if(checkAreaMarkedHidden(hiddenAreaMarkerTypes, area)) {
boolean showAsFallbackArea = false;
// if at least one sub area is not hidden by a marker
- // this area is a fall-back area for this sub area
+ // the given area is a fall-back area for this sub area
for(NamedArea subArea : area.getIncludes()) {
if (!areasHiddenByMarker.contains(subArea) && checkAreaMarkedHidden(hiddenAreaMarkerTypes, subArea)) {
if(filteredDistributions.containsKey(subArea)) {