direction.java
来自「是有关解释器的.用JAVA编写.可以解释一般的JAVA程序.」· Java 代码 · 共 48 行
JAVA
48 行
/*
* 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 + =
减小字号Ctrl + -
显示快捷键?