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

📄 portdoc.java

📁 j2me实现的移动机器人代码(Java实现)
💻 JAVA
字号:
package name.lxm.robot.arch;

import org.jdom.Element;

public class PortDoc
{
	/** name of the port */
	private String name;
	/** type of the port */
	private String type;
	
	/**
	 * Default Constrcutor
	 */
	public PortDoc()
	{
	}
	
	/**
	 * Constructor from XML Segment
	 * @param e org.jdom.Element - XML segement
	 * @throws IllegalFormatException 
	 */
	public PortDoc(Element e) throws IllegalXMLFormatException
	{
		if(e.getName().equals("Port"))
		{
			this.name = e.getAttributeValue("name");
			this.type = e.getAttributeValue("type");
		}
		else
			throw new IllegalXMLFormatException("Name of the elment is not ``Port''");
	}
	
	/**
	 * Constructor
	 * @param name String - name of the port
	 * @param type String - type of the port
	 */
	public PortDoc(String name, String type)
	{
		this.name = name;
		this.type = type;
	}

	/**
	 * get the name of the port
	 * @return the name of the port
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * set the name of the port
	 * @param name - the name of the port
	 */
	public void setName(String name)
	{
		this.name = name;
	}

	/**
	 * get the type of the port
	 * @return the type of the port
	 */
	public String getType()
	{
		return type;
	}

	/**
	 * set the type of the port
	 * @param type - the type of the port
	 */
	public void setType(String type)
	{
		this.type = type;
	}
}

⌨️ 快捷键说明

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