/**\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
import java.util.Map;\r
import java.util.UUID;\r
\r
-import org.apache.log4j.Logger;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
\r
-import eu.etaxonomy.cdm.app.berlinModelImport.TreeCreator;\r
import eu.etaxonomy.cdm.model.description.Feature;\r
-import eu.etaxonomy.cdm.model.description.FeatureNode;\r
-import eu.etaxonomy.cdm.model.description.FeatureTree;\r
+import eu.etaxonomy.cdm.model.term.TermNode;\r
+import eu.etaxonomy.cdm.model.term.TermTree;\r
\r
/**\r
* @author a.mueller\r
- * @created 03.07.2008\r
- * @version 1.0\r
+ * @since 03.07.2008\r
*/\r
public class TreeCreator {\r
@SuppressWarnings("unused")\r
- private static final Logger logger = Logger.getLogger(TreeCreator.class);\r
+ private static final Logger logger = LogManager.getLogger();\r
+\r
+ public static TermTree<Feature> flatTree(UUID featureTreeUuid, Map<Integer, Feature> featureMap, Object[] featureKeyList){\r
+ TermTree<Feature> result = TermTree.NewFeatureInstance(featureTreeUuid);\r
+ TermNode<Feature> root = result.getRoot();\r
\r
- public static FeatureTree flatTree(UUID featureTreeUuid, Map<Integer, Feature> featureMap, Object[] featureKeyList){\r
- FeatureTree result = FeatureTree.NewInstance(featureTreeUuid);\r
- FeatureNode root = result.getRoot();\r
- \r
for (Object featureKey : featureKeyList){\r
Feature feature = featureMap.get(featureKey);\r
if (feature != null){\r
- FeatureNode child = FeatureNode.NewInstance(feature);\r
- root.addChild(child); \r
+ root.addChild(feature);\r
}\r
}\r
return result;\r
}\r
- \r
- \r
+\r
+\r
/**\r
* @param args\r
*/\r
map.put(1, Feature.DISTRIBUTION());\r
map.put(2, Feature.ECOLOGY());\r
\r
- Object[] strFeatureList = new Integer[]{1,2}; \r
+ Object[] strFeatureList = new Integer[]{1,2};\r
\r
- FeatureTree tree = TreeCreator.flatTree(UUID.randomUUID(), map, strFeatureList);\r
+ TermTree<Feature> tree = TreeCreator.flatTree(UUID.randomUUID(), map, strFeatureList);\r
System.out.println(tree.getRootChildren());\r
}\r
}\r