?? unit.java
字號(hào):
/*
* Unit.java
*
* Created on 2006年5月5日, 上午11:20
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.j2medev.chapter4.weather;
/**
*
* @author ming
*/
public class Unit {
private String[] units = new String[4];
public static final int TEMPERATRUE = 0;
public static final int DISTANCE = 1;
public static final int PRESSURE = 2;
public static final int SPEED = 3;
/** Creates a new instance of Unit */
public Unit() {
}
public String get(int field){
if(field < 0 || field > 3)
throw new IllegalArgumentException("The unit field is not defined");
return units[field];
}
public void set(int index,String value){
units[index] = value;
}
//only for debug
public String toString(){
return "temperature : "+units[0]+"\n"
+"distance : "+units[1]+"\n"
+"pressure : "+units[2]+"\n"
+"speed : "+units[3]+"\n";
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -