org.marketcetera.ors
Class OptionRootUnderlyingMap

java.lang.Object
  extended by org.marketcetera.ors.OptionRootUnderlyingMap
All Implemented Interfaces:
InitializingBean

public class OptionRootUnderlyingMap
extends Object
implements InitializingBean

A class that provides a mapping between option roots and underlying symbols based on the mapping provided by the Options Clearing Corporation.

This class can be safely used concurrently from multiple threads.

Since:
2.0.0
Version:
$Id: OptionRootUnderlyingMap.java 16154 2012-07-14 16:34:05Z colin $
Author:
anshul@marketcetera.com

Constructor Summary
OptionRootUnderlyingMap()
          Creates an instance.
 
Method Summary
 void afterPropertiesSet()
           
static OptionRootUnderlyingMap getInstance()
          Returns the singleton instance if initialized, null otherwise.
 Collection<String> getOptionRoots(String inUnderlying)
          Returns the collection of option roots for the underlying symbol.
 String getUnderlying(String inOptionRoot)
          Gets the underlying symbol, given the option root symbol.
 void setFilename(String inFilename)
          The name of the file from which the mappings should be read.
 void setIncludeTypes(String[] inIncludeTypes)
          Sets the type of records to include.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionRootUnderlyingMap

public OptionRootUnderlyingMap()
Creates an instance.

Method Detail

getUnderlying

public String getUnderlying(String inOptionRoot)
Gets the underlying symbol, given the option root symbol.

Parameters:
inOptionRoot - the option root symbol.
Returns:
the underlying symbol, if a mapping is found. null otherwise.

getOptionRoots

public Collection<String> getOptionRoots(String inUnderlying)
Returns the collection of option roots for the underlying symbol.

Parameters:
inUnderlying - the underlying symbol.
Returns:
the sorted collection of option roots for the underlying symbol. If no mapping is found, a null value is returned. The returned collection is not modifiable.

setFilename

public void setFilename(String inFilename)
The name of the file from which the mappings should be read.

Parameters:
inFilename - the file name.

setIncludeTypes

public void setIncludeTypes(String[] inIncludeTypes)
Sets the type of records to include.

Parameters:
inIncludeTypes - the type of records to include. Should not be null.

getInstance

public static OptionRootUnderlyingMap getInstance()
Returns the singleton instance if initialized, null otherwise.

Returns:
the singleton instance.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception


Copyright © 2012. All Rights Reserved.