📄 direction.java
字号:
/*
* Created on 05.10.2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/** * @author Dell
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates */
public final class direction
{
public static final direction NORTH = new direction(3);
public static final direction WEST = new direction(0);
public static final direction SOUTH = new direction(1);
public static final direction EAST = new direction(2);
public static final int NORTH_VALUE = 3;
public static final int WEST_VALUE = 0;
public static final int SOUTH_VALUE = 1;
public static final int EAST_VALUE = 2;
private int value;
private direction(int value) { this.value = value; }
public int getValue() {
return value;
}
public String toString() {
switch(value) {
case NORTH_VALUE:
return "North";
case SOUTH_VALUE:
return "South";
case WEST_VALUE:
return "West";
case EAST_VALUE:
return "East";
default:
throw new IllegalStateException();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -