?? argumentset.java
字號:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Calculator;
/**
*
* @author asus
*/
import java.util.HashMap;
/*I use hash map to store the arg,
* put(K key, V value) to store
* get(Object key) to get the value*/
public class ArgumentSet {
private HashMap<String, Double> args;
public ArgumentSet() {
args = new HashMap<String, Double>();
}
public void setArg(String name, double value) {
args.put(name, value);
//value is automatically cast to Double Class
}
public int sizeOfArgs(){
return args.size();
}
public double getArg(String name) {
Double result = args.get(name);
if (result == null) {
return 0.0;
} else {
return result;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -