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.

Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    CSVGrid()
    Empty CSVGrid Constructor
  • Method Summary

    Modifier and Type Method Description
    boolean add​(java.lang.String[] astr)
    Add a String Array to the Grid
    JulianDate[] dateArrayAtColumn​(int iColumn)
    Retrieve the Array of JulianDate corresponding to the specified Column Index
    double[] doubleArrayAtColumn​(int iColumn)
    Retrieve the Array of Double Values corresponding to the specified Column Index
    double[] doubleArrayAtColumn​(int iColumn, double dblScaler)
    Retrieve the Array of Double Values corresponding to the specified Column Index
    java.util.Map<JulianDate,​java.util.Map<java.lang.Double,​java.lang.Double>> doubleMap​(double dblScaler)
    Construct a Historical Map of Scaled/Keyed Double
    java.util.List<java.lang.String[]> grid()
    Retrieve the Underlying CSV Grid
    java.util.Map<JulianDate,​InstrumentSetTenorQuote> groupedOrderedDouble​(double dblScaler)
    Construct a Historical Map of Scaled/Keyed/Tenor Ordered Double
    java.lang.String header​(int iIndex)
    Retrieve the Header identified by the Index
    java.lang.String[] headers()
    Retrieve the Array of Headers
    int[] intArrayAtColumn​(int iColumn)
    Retrieve the Array of Integer Values corresponding to the specified Column Index
    boolean setHeader​(java.lang.String[] astrHeader)
    Set the Column Headers
    int size()
    Retrieve the Size of the Sample Set
    java.lang.String[] stringArrayAtColumn​(int iColumn)
    Retrieve the Array of String Values corresponding to the specified Column Index
    static JulianDate ToDate​(java.lang.String strElement)
    Convert the String Element to a JulianDate Instance.
    static double ToDouble​(java.lang.String strElement)
    Convert the String Element to double.
    static int ToInteger​(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

      public static final JulianDate ToDate​(java.lang.String strElement)
      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 Index
      dblScaler - 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

      public JulianDate[] dateArrayAtColumn​(int iColumn)
      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

      public java.util.Map<JulianDate,​InstrumentSetTenorQuote> groupedOrderedDouble​(double dblScaler)
      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