Order.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package bible.rmi.example3;
- /**
- * Represents an order for a stock purchase.
- * @note It implements java.io.Serializable to enable marshalling of it as
- * it will be used as a remote parameter.
- */
- public class Order implements java.io.Serializable {
- /** number */
- private int number;
- /** symbol */
- private String symbol;
- /** shares */
- private int shares;
- /**
- * getNumber
- */
- public int getNumber() {
- return number;
- }
- /**
- * setNumber
- * @param num
- */
- public void setNumber(int num) {
- number = num;
- }
- /**
- * getSymbol
- */
- public String getSymbol() {
- return symbol;
- }
- /**
- * setSymbol
- * @param sym
- */
- public void setSymbol(String sym) {
- symbol = sym;
- }
- /**
- * getShares
- */
- public int getShares() {
- return shares;
- }
- /**
- * setShares
- * @param s
- */
- public void setShares(int s) {
- shares = s;
- }
- /**
- * toString
- */
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("Ordern");
- buf.append("n Order Number: " + getNumber());
- buf.append("n Symbol: " + getSymbol());
- buf.append("n Shares: " + getShares());
- return buf.toString();
- }
- }