⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 direction.java

📁 是有关解释器的.用JAVA编写.可以解释一般的JAVA程序.
💻 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 + -