📄 portfolioinfo.java
字号:
/*
* @author : Pushkala
* @version : 1.0
*
* Development Environment : Oracle9i JDeveloper
*
* Name of the File : PortfolioInfo.java
*
* Creation / Modification History
* Pushkala 26-Apr-2002 Created
*
*/
package oracle.otnsamples.ibfbs.trademanagement.ejb;
import java.util.Date;
import java.io.Serializable;
/**
* This Class encapsulates Portfolio Information for a particular User Account.
* Whenever the session facade bean TradeManagementSessionFacadeBean needs to
* query or add Portfolio Info for a particular User Account, it is passed as
* PortfolioInfo value object. Thus this class acts as Value object while
* getting/setting portfolio information between Session Facade Bean and
* the client.
*
* @version 1.0
* @since 1.0
*/
public class PortfolioInfo implements Serializable {
// Declaring instance variables required to store the Portfolio information
/** Line Number */
private Integer lineNo;
/** Stock quantity */
private Integer quantity;
/** Stock Price */
private float price;
/** Stock symbol */
private String symbol;
/** Company Name */
private String companyName;
/** Purchase Date */
private Date purchaseDate;
/** Purchase Mode */
private String purchaseMode;
/** Trade Id */
private Integer tradeId;
/**
* Empty Default Constructor
* @since 1.0
*/
public PortfolioInfo() {}
/**
* This constructor sets the values of the instance variables with the input data
*
* @param lineNo Line Number
* @param quantity Quantity
* @param price Price
* @param symbol Symbol
* @param companyName Company Name
* @param purchaseDate Purchase Date
* @param purchaseMode Purchase Mode
* @param tradeId Trade Id
* @since 1.0
*/
public PortfolioInfo(Integer lineNo, Integer quantity, float price,
String symbol, String companyName, Date purchaseDate,
String purchaseMode, Integer tradeId) {
setLineNo(lineNo);
setQuantity(quantity);
setPrice(price);
setSymbol(symbol);
setCompanyName(companyName);
setPurchaseDate(purchaseDate);
setPurchaseMode(purchaseMode);
setTradeId(tradeId);
}
/**
* Returns the Line Number
*
* @return The Line Number
* @since 1.0
*/
public Integer getLineNo() {
return lineNo;
}
/**
* Sets the Line Number
*
* @param lineNo Line Number
* @since 1.0
*/
private void setLineNo(Integer lineNo) {
this.lineNo = lineNo;
}
/**
* Returns the quantity
*
* @return The Stock Quantity
* @since 1.0
*/
public Integer getQuantity() {
return quantity;
}
/**
* Sets the quantity
*
* @param quantity Quantity
* @since 1.0
*/
private void setQuantity(Integer quantity) {
this.quantity = quantity;
}
/**
* Returns the Price
*
* @return The Current Stock Price
* @since 1.0
*/
public float getPrice() {
return price;
}
/**
* Sets the price
*
* @param price Price
* @since 1.0
*/
private void setPrice(float price) {
this.price = price;
}
/**
* Returns the Stock Symbol
*
* @return The Stock Symbol
* @since 1.0
*/
public String getSymbol() {
return symbol;
}
/**
* Sets the Stock Symbol
*
* @param symbol Symbol
* @since 1.0
*/
private void setSymbol(String symbol) {
this.symbol = symbol;
}
/**
* Returns the Company Name
*
* @return The Company Name
* @since 1.0
*/
public String getCompanyName() {
return companyName;
}
/**
* Sets the company name
*
* @param companyName Company Name
* @since 1.0
*/
private void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* Returns the Purchase Date
*
* @return The Purchase Date of the Stock
* @since 1.0
*/
public Date getPurchaseDate() {
return purchaseDate;
}
/**
* Sets the Purchase Date
*
* @param purchaseDate Purchase Date
* @since 1.0
*/
private void setPurchaseDate(Date purchaseDate) {
this.purchaseDate = purchaseDate;
}
/**
* Returns the Purchase Mode
*
* @return The mode of purchase of the Stock
* @since 1.0
*/
public String getPurchaseMode() {
return purchaseMode;
}
/**
* Sets the Purchase Mode
*
* @param purchaseMode Purchase Mode
* @since 1.0
*/
private void setPurchaseMode(String purchaseMode) {
this.purchaseMode = purchaseMode;
}
/**
* Returns the Trade Id
*
* @return The Trade Id
* @since 1.0
*/
public Integer getTradeId() {
return tradeId;
}
/**
* Sets the Trade Id
*
* @param tradeId Trade Id
* @since 1.0
*/
private void setTradeId(Integer tradeId) {
this.tradeId = tradeId;
}
/**
* Method to get String representation of this class.
* Overrides the method toString() in java.lang.Object
*
* @return String representation of this class.
* @since 1.0
*/
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("Line Number : " ).append(this.getLineNo());
sb.append(" Quantity : " ).append(this.getQuantity());
sb.append(" Price : " ).append(this.getPrice());
sb.append(" Symbol : " ).append(this.getSymbol());
sb.append(" Purchase Date : ").append(this.getPurchaseDate());
sb.append(" Purchase Mode : ").append(this.getPurchaseMode());
sb.append(" Trade Id : " ).append(this.getTradeId());
return sb.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -