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

📄 commandstatus.java

📁 DTNSim2 is a simulator for Delay-Tolerant Networks (DTNs) written in Java. It is based on Sushant Ja
💻 JAVA
字号:
/** * util/CommandStatus.java */package util;/** *  */public class CommandStatus{	public static final int COMMAND_FAILED = 1;	public static final int COMMAND_OK = 2;	public String message = null;	public int commandStatus = COMMAND_FAILED;	public CommandStatus(int status)	{		commandStatus = status;		message = null;	}	public CommandStatus(String msg)	{		commandStatus = COMMAND_FAILED;		message = msg;	}	public CommandStatus(int status, String msg)	{		commandStatus = status;		message = msg;	}	public int getStatus()	{		return commandStatus;	}	public String getMessage()	{		return message;	}	public void printStatus(String line, String stream)	{		if (commandStatus == COMMAND_OK)		{			if (message != null)				System.out.println(message);			return;		}		if (message != null)			System.err.println("Error interpreting line '" + line + "' from stream '" + stream + "': " + message);		else			System.err.println("Error interpreting line '" + line + "' from stream '" + stream + "'");		System.exit(-1);	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -