View Javadoc

1   /*
2    *  
3    *  author nambi sankaran
4    *  copyright (C) 2009 nambi sankaran.
5    *
6    *  This program is free software: you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation, either version 3 of the License, or
9    *  (at your option) any later version.
10   *
11   *  This program is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   *  GNU General Public License for more details.
15   *
16   *  You should have received a copy of the GNU General Public License
17   *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   *
19   */
20  package net.sf.emarket.trade.domain;
21  
22  import java.sql.Timestamp;
23  
24  import net.sf.emarket.order.domain.Order;
25  
26  public class ReceivedOrder extends Order {
27  
28  	private Timestamp receivedTime = null;
29  	private String processingStatus = null;
30  	
31  	public ReceivedOrder(){
32  	}
33  	
34  	public ReceivedOrder( Order order){
35  		setAcctId(order.getAcctId());
36  		setCommission(order.getCommission());
37  		setCreationTime(order.getCreationTime());
38  		setExchange(order.getExchange());
39  		setId(order.getId());
40  		setLimitPrice(order.getLimitPrice());
41  		setOrderTerm(order.getOrderTerm());
42  		setOrderType(order.getOrderType());
43  		setPriceType(order.getPriceType());
44  		setQuantity(order.getQuantity());
45  		setQuoteId(order.getQuoteId());
46  		setStatus(order.getStatus());
47  		setSymbol(order.getSymbol());
48  		setTime(order.getTime());
49  		setTotalCost(order.getTotalCost());
50  	}
51  
52  	public Timestamp getReceivedTime() {
53  		return receivedTime;
54  	}
55  
56  	public void setReceivedTime(Timestamp receivedTime) {
57  		this.receivedTime = receivedTime;
58  	}
59  	
60  	public String getProcessingStatus() {
61  		return processingStatus;
62  	}
63  
64  	public void setProcessingStatus(String processingStatus) {
65  		this.processingStatus = processingStatus;
66  	}
67  
68  	public static final String PROCESSING_STATUS_NOT_RECEIVED  =  "NOT_RECEIVED";
69  	public static final String PROCESSING_STATUS_RECEIVED  =  "RECEIVED";
70  	public static final String PROCESSING_STATUS_PROCESSING  =  "PROCESSING";
71  	public static final String PROCESSING_STATUS_MATCHED  =  "MATCHED";
72  	public static final String PROCESSING_STATUS_PARTIALLY_MATCHED  =  "PARTIALLY_MATCHED";
73  	
74      // order comparison by time
75      public int compareCreateTimeTo( Order o ){
76      	return (int) getCreationTime().compareTo(o.getCreationTime());
77      }	
78  }