From: <jen...@us...> - 2007-11-25 11:37:57
|
Revision: 289 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=289&view=rev Author: jenslehmann Date: 2007-11-25 03:37:52 -0800 (Sun, 25 Nov 2007) Log Message: ----------- small example for Tilo Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/ComponentManager.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/gui/ComponentRetrievalTest.java Modified: trunk/src/dl-learner/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2007-11-24 09:04:49 UTC (rev 288) +++ trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2007-11-25 11:37:52 UTC (rev 289) @@ -64,11 +64,11 @@ // these variables are valid for the complete lifetime of DL-Learner private static String componentsFile = "lib/components.ini"; private static ComponentManager cm = new ComponentManager(); - private static Set<Class<? extends Component>> components; - private static Set<Class<? extends KnowledgeSource>> knowledgeSources; - private static Set<Class<? extends ReasonerComponent>> reasonerComponents; - private static Set<Class<? extends LearningProblem>> learningProblems; - private static Set<Class<? extends LearningAlgorithm>> learningAlgorithms; + private static Collection<Class<? extends Component>> components; + private static Collection<Class<? extends KnowledgeSource>> knowledgeSources; + private static Collection<Class<? extends ReasonerComponent>> reasonerComponents; + private static Collection<Class<? extends LearningProblem>> learningProblems; + private static Collection<Class<? extends LearningAlgorithm>> learningAlgorithms; // list of all configuration options of all components private static Map<Class<? extends Component>, String> componentNames; @@ -486,38 +486,36 @@ /** * @return the components */ - public static Set<Class<? extends Component>> getComponents() { - return components; + public List<Class<? extends Component>> getComponents() { + return new LinkedList<Class<? extends Component>>(components); } /** * @return the knowledgeSources */ - public static Set<Class<? extends KnowledgeSource>> getKnowledgeSources() { - return knowledgeSources; + public List<Class<? extends KnowledgeSource>> getKnowledgeSources() { + return new LinkedList<Class<? extends KnowledgeSource>>(knowledgeSources); } /** * @return the reasonerComponents */ - public static Set<Class<? extends ReasonerComponent>> getReasonerComponents() { - return reasonerComponents; + public List<Class<? extends ReasonerComponent>> getReasonerComponents() { + return new LinkedList<Class<? extends ReasonerComponent>>(reasonerComponents); } /** * @return the learningProblems */ - public static Set<Class<? extends LearningProblem>> getLearningProblems() { - return learningProblems; + public List<Class<? extends LearningProblem>> getLearningProblems() { + return new LinkedList<Class<? extends LearningProblem>>(learningProblems); } /** * @return the learningAlgorithms */ - public static Set<Class<? extends LearningAlgorithm>> getLearningAlgorithms() { - return learningAlgorithms; + public List<Class<? extends LearningAlgorithm>> getLearningAlgorithms() { + return new LinkedList<Class<? extends LearningAlgorithm>>(learningAlgorithms); } - - } Added: trunk/src/dl-learner/org/dllearner/gui/ComponentRetrievalTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ComponentRetrievalTest.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/gui/ComponentRetrievalTest.java 2007-11-25 11:37:52 UTC (rev 289) @@ -0,0 +1,42 @@ +/** + * Copyright (C) 2007, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.gui; + +import java.util.List; + +import org.dllearner.core.ComponentManager; +import org.dllearner.core.KnowledgeSource; + +/** + * @author Jens Lehmann + * + */ +public class ComponentRetrievalTest { + + /** + * @param args + */ + public static void main(String[] args) { + ComponentManager cm = ComponentManager.getInstance(); + List<Class<? extends KnowledgeSource>> sources = cm.getKnowledgeSources(); + cm.knowledgeSource(sources.get(0)); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |