Example usage for org.apache.commons.collections.map ReferenceIdentityMap ReferenceIdentityMap

List of usage examples for org.apache.commons.collections.map ReferenceIdentityMap ReferenceIdentityMap

Introduction

In this page you can find the example usage for org.apache.commons.collections.map ReferenceIdentityMap ReferenceIdentityMap.

Prototype

public ReferenceIdentityMap() 

Source Link

Document

Constructs a new ReferenceIdentityMap that will use hard references to keys and soft references to values.

Usage

From source file:net.sourceforge.eclipsetrader.core.internal.XMLRepository.java

public void clear() {
    File file = new File(Platform.getLocation().toFile(), "securities.xml"); //$NON-NLS-1$
    if (file.exists() == true)
        file.delete();/*w w w.  ja v  a2s.c om*/
    file = new File(Platform.getLocation().toFile(), "watchlists.xml"); //$NON-NLS-1$
    if (file.exists() == true)
        file.delete();
    file = new File(Platform.getLocation().toFile(), "charts.xml"); //$NON-NLS-1$
    if (file.exists() == true)
        file.delete();
    file = new File(Platform.getLocation().toFile(), "news.xml"); //$NON-NLS-1$
    if (file.exists() == true)
        file.delete();
    file = new File(Platform.getLocation().toFile(), "accounts.xml"); //$NON-NLS-1$
    if (file.exists() == true)
        file.delete();
    file = new File(Platform.getLocation().toFile(), "events.xml"); //$NON-NLS-1$
    if (file.exists() == true)
        file.delete();
    file = new File(Platform.getLocation().toFile(), "orders.xml"); //$NON-NLS-1$
    if (file.exists() == true)
        file.delete();

    for (Iterator iter = allSecurities().iterator(); iter.hasNext();) {
        Security security = (Security) iter.next();
        file = new File(Platform.getLocation().toFile(),
                "history/" + String.valueOf(security.getId()) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$  $NON-NLS-2$
        if (file.exists() == true)
            file.delete();
        file = new File(Platform.getLocation().toFile(),
                "intraday/" + String.valueOf(security.getId()) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$  $NON-NLS-2$
        if (file.exists() == true)
            file.delete();
    }

    securitiesNextId = new Integer(1);
    securitiesGroupNextId = new Integer(1);
    securitiesMap = new HashMap();
    securityGroupsMap = new HashMap();
    chartsNextId = new Integer(1);
    chartsMap = new HashMap();
    watchlistsNextId = new Integer(1);
    watchlistsMap = new HashMap();
    accountGroupNextId = new Integer(1);
    accountGroupMap = new HashMap();
    accountNextId = new Integer(1);
    accountMap = new HashMap();
    eventNextId = new Integer(1);
    orderNextId = new Integer(1);
    tradingRepository.clear();
    historyMap = new ReferenceIdentityMap();
    intradayHistoryMap = new ReferenceIdentityMap();

    super.clear();
}