[eclipsefinance-subversion] SF.net SVN: eclipsefinance: [35] trunk/net.sf.eclipsefinance.core/src/n
Status: Pre-Alpha
Brought to you by:
yukio7
|
From: <yu...@us...> - 2006-09-22 12:53:10
|
Revision: 35
http://svn.sourceforge.net/eclipsefinance/?rev=35&view=rev
Author: yukio7
Date: 2006-09-22 05:52:57 -0700 (Fri, 22 Sep 2006)
Log Message:
-----------
fix: compilation errors
Modified Paths:
--------------
trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/model/AccountGroup.java
trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/Account.java
trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/AccountGroup.java
trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/Repository.java
Modified: trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/model/AccountGroup.java
===================================================================
--- trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/model/AccountGroup.java 2006-09-21 12:09:06 UTC (rev 34)
+++ trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/model/AccountGroup.java 2006-09-22 12:52:57 UTC (rev 35)
@@ -68,15 +68,15 @@
if (accounts == null)
{
accounts = new ObservableList();
- if (getRepository() != null)
- {
- for (Iterator iter = getRepository().allAccounts().iterator(); iter.hasNext(); )
- {
- Account account = (Account) iter.next();
- if (this.equals(account.getGroup()))
- accounts.add(account);
- }
- }
+// if (getRepository() != null)
+// {
+// for (Iterator iter = getRepository().allAccounts().iterator(); iter.hasNext(); )
+// {
+// Account account = (Account) iter.next();
+// if (this.equals(account.getGroup()))
+// accounts.add(account);
+// }
+// }
}
return accounts;
}
Modified: trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/Account.java
===================================================================
--- trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/Account.java 2006-09-21 12:09:06 UTC (rev 34)
+++ trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/Account.java 2006-09-22 12:52:57 UTC (rev 35)
@@ -177,82 +177,82 @@
for (int i = 0; i < objs.length; i++)
{
Transaction transaction = (Transaction)objs[i];
- double amount = transaction.getAmount();
- if (getCurrency() != null && !getCurrency().equals(transaction.getSecurity().getCurrency()))
- amount = CurrencyConverter.getInstance().convert(transaction.getDate(), amount, transaction.getSecurity().getCurrency(), getCurrency());
+ double amount = transaction.getAmount().doubleValue();
+// if (getCurrency() != null && !getCurrency().equals(transaction.getSecurity().getCurrency()))
+// amount = CurrencyConverter.getInstance().convert(transaction.getDate(), amount, transaction.getSecurity().getCurrency(), getCurrency());
result += amount;
}
return result;
}
- /**
- * Return the number of stocks held for the given security.
- *
- * @param security the security to search
- * @return holded quantity
- */
- public int getPosition(Security security)
- {
- int result = 0;
-
- Object[] objs = getTransactions().toArray();
- for (int i = 0; i < objs.length; i++)
- {
- Transaction transaction = (Transaction)objs[i];
- if (transaction.getSecurity().equals(security))
- result += transaction.getQuantity();
- }
-
- return result;
- }
+// /**
+// * Return the number of stocks held for the given security.
+// *
+// * @param security the security to search
+// * @return holded quantity
+// */
+// public int getPosition(Security security)
+// {
+// int result = 0;
+//
+// Object[] objs = getTransactions().toArray();
+// for (int i = 0; i < objs.length; i++)
+// {
+// Transaction transaction = (Transaction)objs[i];
+// if (transaction.getSecurity().equals(security))
+// result += transaction.getQuantity();
+// }
+//
+// return result;
+// }
- public List getPortfolio()
- {
- List result = new ArrayList();
-
- Map map = new HashMap();
- for (Iterator iter2 = getTransactions().iterator(); iter2.hasNext(); )
- {
- Transaction transaction = (Transaction)iter2.next();
- PortfolioPosition position = (PortfolioPosition)map.get(transaction.getSecurity());
- if (position == null)
- map.put(transaction.getSecurity(), new PortfolioPosition(this, transaction.getSecurity(), transaction.getQuantity(), transaction.getAmount()));
- else
- position.add(transaction.getQuantity(), transaction.getAmount());
- }
-
- List list = new ArrayList(map.keySet());
- Collections.sort(list, new Comparator() {
- public int compare(Object arg0, Object arg1)
- {
- return ((Security)arg0).getDescription().compareTo(((Security)arg1).getDescription());
- }
- });
- for (Iterator iter = list.iterator(); iter.hasNext(); )
- {
- Security security = (Security)iter.next();
- PortfolioPosition position = (PortfolioPosition)map.get(security);
- if (position.getQuantity() != 0)
- result.add(position);
- }
-
- return result;
- }
+// public List getPortfolio()
+// {
+// List result = new ArrayList();
+//
+// Map map = new HashMap();
+// for (Iterator iter2 = getTransactions().iterator(); iter2.hasNext(); )
+// {
+// Transaction transaction = (Transaction)iter2.next();
+// PortfolioPosition position = (PortfolioPosition)map.get(transaction.getSecurity());
+// if (position == null)
+// map.put(transaction.getSecurity(), new PortfolioPosition(this, transaction.getSecurity(), transaction.getQuantity(), transaction.getAmount()));
+// else
+// position.add(transaction.getQuantity(), transaction.getAmount());
+// }
+//
+// List list = new ArrayList(map.keySet());
+// Collections.sort(list, new Comparator() {
+// public int compare(Object arg0, Object arg1)
+// {
+// return ((Security)arg0).getDescription().compareTo(((Security)arg1).getDescription());
+// }
+// });
+// for (Iterator iter = list.iterator(); iter.hasNext(); )
+// {
+// Security security = (Security)iter.next();
+// PortfolioPosition position = (PortfolioPosition)map.get(security);
+// if (position.getQuantity() != 0)
+// result.add(position);
+// }
+//
+// return result;
+// }
- public PortfolioPosition getPortfolio(Security security)
- {
- PortfolioPosition position = new PortfolioPosition(this, security, 0, 0);
-
- for (Iterator iter2 = getTransactions().iterator(); iter2.hasNext(); )
- {
- Transaction transaction = (Transaction)iter2.next();
- if (position.getSecurity().equals(transaction.getSecurity()))
- position.add(transaction.getQuantity(), transaction.getAmount());
- }
-
- return position;
- }
+// public PortfolioPosition getPortfolio(Security security)
+// {
+// PortfolioPosition position = new PortfolioPosition(this, security, 0, 0);
+//
+// for (Iterator iter2 = getTransactions().iterator(); iter2.hasNext(); )
+// {
+// Transaction transaction = (Transaction)iter2.next();
+// if (position.getSecurity().equals(transaction.getSecurity()))
+// position.add(transaction.getQuantity(), transaction.getAmount());
+// }
+//
+// return position;
+// }
public double getExpenses(Security security, int quantity, double price)
{
Modified: trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/AccountGroup.java
===================================================================
--- trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/AccountGroup.java 2006-09-21 12:09:06 UTC (rev 34)
+++ trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/AccountGroup.java 2006-09-22 12:52:57 UTC (rev 35)
@@ -14,7 +14,7 @@
import java.util.Iterator;
-import net.sourceforge.eclipsetrader.core.ObservableList;
+import net.sf.eclipsefinance.core.ObservableList;
public class AccountGroup extends PersistentObject
{
Modified: trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/Repository.java
===================================================================
--- trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/Repository.java 2006-09-21 12:09:06 UTC (rev 34)
+++ trunk/net.sf.eclipsefinance.core/src/net/sf/eclipsefinance/core/persistence/Repository.java 2006-09-22 12:52:57 UTC (rev 35)
@@ -12,26 +12,12 @@
package net.sf.eclipsefinance.core.persistence;
import java.util.ArrayList;
-import java.util.Calendar;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Observable;
import net.sf.eclipsefinance.core.ObservableList;
-import net.sourceforge.eclipsetrader.core.db.Account;
-import net.sourceforge.eclipsetrader.core.db.AccountGroup;
-import net.sourceforge.eclipsetrader.core.db.Chart;
-import net.sourceforge.eclipsetrader.core.db.Event;
-import net.sourceforge.eclipsetrader.core.db.NewsItem;
-import net.sourceforge.eclipsetrader.core.db.Order;
-import net.sourceforge.eclipsetrader.core.db.PersistentObject;
-import net.sourceforge.eclipsetrader.core.db.Security;
-import net.sourceforge.eclipsetrader.core.db.SecurityGroup;
-import net.sourceforge.eclipsetrader.core.db.Watchlist;
-import net.sourceforge.eclipsetrader.core.db.WatchlistItem;
-import net.sourceforge.eclipsetrader.core.db.trading.TradingSystem;
/**
@@ -141,12 +127,12 @@
if (obj instanceof Account)
{
- TradingSystem[] systems = (TradingSystem[])getTradingSystems().toArray(new TradingSystem[0]);
- for (int i = 0; i < systems.length; i++)
- {
- if (obj.equals(systems[i].getAccount()))
- delete(systems[i]);
- }
+// TradingSystem[] systems = (TradingSystem[])getTradingSystems().toArray(new TradingSystem[0]);
+// for (int i = 0; i < systems.length; i++)
+// {
+// if (obj.equals(systems[i].getAccount()))
+// delete(systems[i]);
+// }
allAccounts().remove(obj);
if (((Account)obj).getGroup() != null)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|