Package org.drip.feed.loader
Class CSVGrid
java.lang.Object
org.drip.feed.loader.CSVGrid
public class CSVGrid
extends java.lang.Object
CSVGrid Holds the Outputs of a CSV Parsing Exercise.
- Module = Computational Core Module
- Library = Computation Support
- Project = Load, Transform, and compute Target Metrics across Feeds
- Package = Reference/Market Data Feed Loader
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description CSVGrid()Empty CSVGrid Constructor -
Method Summary
Modifier and Type Method Description booleanadd(java.lang.String[] astr)Add a String Array to the GridJulianDate[]dateArrayAtColumn(int iColumn)Retrieve the Array of JulianDate corresponding to the specified Column Indexdouble[]doubleArrayAtColumn(int iColumn)Retrieve the Array of Double Values corresponding to the specified Column Indexdouble[]doubleArrayAtColumn(int iColumn, double dblScaler)Retrieve the Array of Double Values corresponding to the specified Column Indexjava.util.Map<JulianDate,java.util.Map<java.lang.Double,java.lang.Double>>doubleMap(double dblScaler)Construct a Historical Map of Scaled/Keyed Doublejava.util.List<java.lang.String[]>grid()Retrieve the Underlying CSV Gridjava.util.Map<JulianDate,InstrumentSetTenorQuote>groupedOrderedDouble(double dblScaler)Construct a Historical Map of Scaled/Keyed/Tenor Ordered Doublejava.lang.Stringheader(int iIndex)Retrieve the Header identified by the Indexjava.lang.String[]headers()Retrieve the Array of Headersint[]intArrayAtColumn(int iColumn)Retrieve the Array of Integer Values corresponding to the specified Column IndexbooleansetHeader(java.lang.String[] astrHeader)Set the Column Headersintsize()Retrieve the Size of the Sample Setjava.lang.String[]stringArrayAtColumn(int iColumn)Retrieve the Array of String Values corresponding to the specified Column Indexstatic JulianDateToDate(java.lang.String strElement)Convert the String Element to a JulianDate Instance.static doubleToDouble(java.lang.String strElement)Convert the String Element to double.static intToInteger(java.lang.String strElement)Convert the String Element to int.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
CSVGrid
public CSVGrid()Empty CSVGrid Constructor
-
-
Method Details
-
ToDouble
public static final double ToDouble(java.lang.String strElement)Convert the String Element to double. Fall back is NaN.- Parameters:
strElement- String Element- Returns:
- The Return Value
-
ToInteger
public static final int ToInteger(java.lang.String strElement)Convert the String Element to int. Fall back is MIN_VALUE.- Parameters:
strElement- String Element- Returns:
- The Return Value
-
ToDate
Convert the String Element to a JulianDate Instance.- Parameters:
strElement- String Element- Returns:
- The Return Value
-
grid
public java.util.List<java.lang.String[]> grid()Retrieve the Underlying CSV Grid- Returns:
- The Underlying CSV Field Grid
-
size
public int size()Retrieve the Size of the Sample Set- Returns:
- Size of the Sample Set
-
setHeader
public boolean setHeader(java.lang.String[] astrHeader)Set the Column Headers- Parameters:
astrHeader- The Column Headers- Returns:
- TRUE - Column Headers successfully set
-
add
public boolean add(java.lang.String[] astr)Add a String Array to the Grid- Parameters:
astr- The String Array- Returns:
- TRUE - The String Array successfully added
-
headers
public java.lang.String[] headers()Retrieve the Array of Headers- Returns:
- The Header Array
-
header
public java.lang.String header(int iIndex)Retrieve the Header identified by the Index- Parameters:
iIndex- The Index- Returns:
- The Header identified by the Index
-
stringArrayAtColumn
public java.lang.String[] stringArrayAtColumn(int iColumn)Retrieve the Array of String Values corresponding to the specified Column Index- Parameters:
iColumn- The Column Index- Returns:
- The Array of Strings
-
intArrayAtColumn
public int[] intArrayAtColumn(int iColumn)Retrieve the Array of Integer Values corresponding to the specified Column Index- Parameters:
iColumn- The Column Index- Returns:
- The Array of Integers
-
doubleArrayAtColumn
public double[] doubleArrayAtColumn(int iColumn, double dblScaler)Retrieve the Array of Double Values corresponding to the specified Column Index- Parameters:
iColumn- The Column IndexdblScaler- The Scaling Multiplier- Returns:
- The Array of Doubles
-
doubleArrayAtColumn
public double[] doubleArrayAtColumn(int iColumn)Retrieve the Array of Double Values corresponding to the specified Column Index- Parameters:
iColumn- The Column Index- Returns:
- The Array of Doubles
-
dateArrayAtColumn
Retrieve the Array of JulianDate corresponding to the specified Column Index- Parameters:
iColumn- The Column Index- Returns:
- The Array of JulianDate
-
doubleMap
public java.util.Map<JulianDate,java.util.Map<java.lang.Double,java.lang.Double>> doubleMap(double dblScaler)Construct a Historical Map of Scaled/Keyed Double- Parameters:
dblScaler- The Scale to be applied- Returns:
- Historical Map of Scaled/Keyed Double
-
groupedOrderedDouble
Construct a Historical Map of Scaled/Keyed/Tenor Ordered Double- Parameters:
dblScaler- The Scale to be applied- Returns:
- Historical Map of Scaled/Keyed/Tenor Ordered Double
-