001 /*
002 * Copyright (C) 2008-2009 Holger Arndt, A. Naegele and M. Bundschus
003 *
004 * This file is part of the Java Data Mining Package (JDMP).
005 * See the NOTICE file distributed with this work for additional
006 * information regarding copyright ownership and licensing.
007 *
008 * JDMP is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU Lesser General Public License as
010 * published by the Free Software Foundation; either version 2
011 * of the License, or (at your option) any later version.
012 *
013 * JDMP is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016 * GNU Lesser General Public License for more details.
017 *
018 * You should have received a copy of the GNU Lesser General Public
019 * License along with JDMP; if not, write to the
020 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
021 * Boston, MA 02110-1301 USA
022 */
023
024 package org.jdmp.core.algorithm;
025
026 import java.util.Collections;
027 import java.util.HashMap;
028 import java.util.Map;
029
030 import org.jdmp.core.algorithm.basic.About;
031 import org.jdmp.core.algorithm.basic.Abs;
032 import org.jdmp.core.algorithm.basic.Cd;
033 import org.jdmp.core.algorithm.basic.ClassPath;
034 import org.jdmp.core.algorithm.basic.Clone;
035 import org.jdmp.core.algorithm.basic.Copy;
036 import org.jdmp.core.algorithm.basic.CreateDiskMap;
037 import org.jdmp.core.algorithm.basic.CreateEmptyMatrix;
038 import org.jdmp.core.algorithm.basic.CreateHenon;
039 import org.jdmp.core.algorithm.basic.CreateIris;
040 import org.jdmp.core.algorithm.basic.CreateLinReg;
041 import org.jdmp.core.algorithm.basic.CreateListMatrix;
042 import org.jdmp.core.algorithm.basic.CreateMLP;
043 import org.jdmp.core.algorithm.basic.CreateModule;
044 import org.jdmp.core.algorithm.basic.CreateNaiveBayes;
045 import org.jdmp.core.algorithm.basic.CreateSunSpotData;
046 import org.jdmp.core.algorithm.basic.Env;
047 import org.jdmp.core.algorithm.basic.Exec;
048 import org.jdmp.core.algorithm.basic.Exit;
049 import org.jdmp.core.algorithm.basic.Export;
050 import org.jdmp.core.algorithm.basic.Gauss;
051 import org.jdmp.core.algorithm.basic.Help;
052 import org.jdmp.core.algorithm.basic.Import;
053 import org.jdmp.core.algorithm.basic.Info;
054 import org.jdmp.core.algorithm.basic.LogisticFunction;
055 import org.jdmp.core.algorithm.basic.Logisticmap;
056 import org.jdmp.core.algorithm.basic.Mean;
057 import org.jdmp.core.algorithm.basic.Memory;
058 import org.jdmp.core.algorithm.basic.Minus;
059 import org.jdmp.core.algorithm.basic.Mtimes;
060 import org.jdmp.core.algorithm.basic.Ones;
061 import org.jdmp.core.algorithm.basic.Paste;
062 import org.jdmp.core.algorithm.basic.Plus;
063 import org.jdmp.core.algorithm.basic.Processors;
064 import org.jdmp.core.algorithm.basic.Properties;
065 import org.jdmp.core.algorithm.basic.Pwd;
066 import org.jdmp.core.algorithm.basic.Rand;
067 import org.jdmp.core.algorithm.basic.Randn;
068 import org.jdmp.core.algorithm.basic.Repeat;
069 import org.jdmp.core.algorithm.basic.Seed;
070 import org.jdmp.core.algorithm.basic.SerialExecution;
071 import org.jdmp.core.algorithm.basic.Show;
072 import org.jdmp.core.algorithm.basic.ShowLicense;
073 import org.jdmp.core.algorithm.basic.Sum;
074 import org.jdmp.core.algorithm.basic.Systemtime;
075 import org.jdmp.core.algorithm.basic.Tanh;
076 import org.jdmp.core.algorithm.basic.TanhPlusOne;
077 import org.jdmp.core.algorithm.basic.Threads;
078 import org.jdmp.core.algorithm.basic.Times;
079 import org.jdmp.core.algorithm.basic.Transpose;
080 import org.jdmp.core.algorithm.basic.Version;
081 import org.jdmp.core.algorithm.basic.Zeros;
082 import org.ujmp.core.listmatrix.DefaultListMatrix;
083 import org.ujmp.core.listmatrix.ListMatrix;
084
085 public abstract class AlgorithmMapping {
086
087 private static Map<String, String> mapping = new HashMap<String, String>();
088
089 static {
090 mapping.put("about", About.class.getName());
091 mapping.put("abs", Abs.class.getName());
092 mapping.put("cd", Cd.class.getName());
093 mapping.put("clone", Clone.class.getName());
094 mapping.put("copy", Copy.class.getName());
095 mapping.put("classpath", ClassPath.class.getName());
096 mapping.put("diskmap", CreateDiskMap.class.getName());
097 mapping.put("empty", CreateEmptyMatrix.class.getName());
098 mapping.put("env", Env.class.getName());
099 mapping.put("exec", Exec.class.getName());
100 mapping.put("exit", Exit.class.getName());
101 mapping.put("export", Export.class.getName());
102 mapping.put("gauss", Gauss.class.getName());
103 mapping.put("help", Help.class.getName());
104 mapping.put("henon", CreateHenon.class.getName());
105 mapping.put("import", Import.class.getName());
106 mapping.put("info", Info.class.getName());
107 mapping.put("iris", CreateIris.class.getName());
108 mapping.put("license", ShowLicense.class.getName());
109 mapping.put("linreg", CreateLinReg.class.getName());
110 mapping.put("list", CreateListMatrix.class.getName());
111 mapping.put("logistic", LogisticFunction.class.getName());
112 mapping.put("logmap", Logisticmap.class.getName());
113 mapping.put("map", org.jdmp.core.algorithm.basic.CreateMapMatrix.class.getName());
114 mapping.put("mean", Mean.class.getName());
115 mapping.put("mem", Memory.class.getName());
116 mapping.put("minus", Minus.class.getName());
117 mapping.put("mlp", CreateMLP.class.getName());
118 mapping.put("module", CreateModule.class.getName());
119 mapping.put("mtimes", Mtimes.class.getName());
120 mapping.put("naivebayes", CreateNaiveBayes.class.getName());
121 mapping.put("ones", Ones.class.getName());
122 mapping.put("paste", Paste.class.getName());
123 mapping.put("plus", Plus.class.getName());
124 mapping.put("processors", Processors.class.getName());
125 mapping.put("properties", Properties.class.getName());
126 mapping.put("pwd", Pwd.class.getName());
127 mapping.put("rand", Rand.class.getName());
128 mapping.put("randn", Randn.class.getName());
129 mapping.put("repeat", Repeat.class.getName());
130 mapping.put("sample", org.jdmp.core.algorithm.basic.CreateSample.class.getName());
131 mapping.put("seed", Seed.class.getName());
132 mapping.put("serial", SerialExecution.class.getName());
133 mapping.put("show", Show.class.getName());
134 mapping.put("sunspot", CreateSunSpotData.class.getName());
135 mapping.put("sum", Sum.class.getName());
136 mapping.put("time", Systemtime.class.getName());
137 mapping.put("tanh", Tanh.class.getName());
138 mapping.put("tanhPlus1", TanhPlusOne.class.getName());
139 mapping.put("threads", Threads.class.getName());
140 mapping.put("time", Systemtime.class.getName());
141 mapping.put("times", Times.class.getName());
142 mapping.put("transpose", Transpose.class.getName());
143 mapping.put("version", Version.class.getName());
144 mapping.put("zeros", Zeros.class.getName());
145 }
146
147 public static final String get(String key) {
148 return mapping.get(key);
149 }
150
151 public static final ListMatrix<String> list() {
152 ListMatrix<String> list = new DefaultListMatrix<String>(mapping.keySet());
153 Collections.sort(list);
154 return list;
155 }
156
157 }