📄 symbolfactory.java
字号:
package com.lqy.GEP;
import java.util.*;
public class SymbolFactory {
private Hashtable<String, Symbol> map=new Hashtable<String,Symbol>();
private static SymbolFactory inst;
public SymbolFactory(){
map.put("+2", new ADD2());
map.put("+3", new ADD3());
map.put("+4", new ADD4());
map.put("*2", new MUL2());
map.put("*3", new MUL3());
map.put("*4", new MUL4());
map.put("exp",new EXP());
map.put("k1", new PolyKernel());
map.put("k2", new GaussKernel());
map.put("k3", new SigKernel());
}
public static SymbolFactory getInstance(){
if(inst==null)
inst=new SymbolFactory();
return inst;
}
public Symbol creatSymbol(String argS){
Symbol tempS=null;
try{
tempS=map.get(argS);
//return tempS;
}catch(Exception e){
System.err.print(e);
}
return tempS;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -