java.lang.Object
org.drip.portfolioconstruction.core.Block
org.drip.portfolioconstruction.composite.Holdings

public class Holdings
extends Block
Holdings is a Portfolio of Holdings in the specified Set of Assets.

Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    Holdings​(java.lang.String name, java.lang.String id, java.lang.String description, java.lang.String currency)
    Holdings Constructor
  • Method Summary

    Modifier and Type Method Description
    boolean add​(java.lang.String assetID, double quantity)
    Add an Asset/Amount Pair
    java.util.Set<java.lang.String> assetIDSet()
    Retrieve the Set of Asset IDs
    double cash()
    Retrieves the Cash Holdings
    double[] constrict​(Holdings holdingsOther)
    Constrict "This" Holdings to those of the Assets in the "Other" Holdings
    boolean contains​(java.lang.String assetID)
    Indicates if an Asset exists in the Holdings
    java.lang.String currency()
    Retrieve the Currency
    double quantity​(java.lang.String assetID)
    Retrieves the Holdings Quantity for the Asset (if it exists)
    java.util.Map<java.lang.String,​java.lang.Double> quantityMap()
    Retrieve the Map of Holdings Amount
    double[] toArray()
    Retrieve the Array Form of the Holdings Quantity

    Methods inherited from class org.drip.portfolioconstruction.core.Block

    description, hashCode, id, name, Standard, timeStamp

    Methods inherited from class java.lang.Object

    equals, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Holdings

      public Holdings​(java.lang.String name, java.lang.String id, java.lang.String description, java.lang.String currency) throws java.lang.Exception
      Holdings Constructor
      Parameters:
      name - The Asset Name
      id - The Asset ID
      description - The Asset Description
      currency - The Account Currency
      Throws:
      java.lang.Exception - Thrown if the Inputs are Invalid
  • Method Details

    • assetIDSet

      public java.util.Set<java.lang.String> assetIDSet()
      Retrieve the Set of Asset IDs
      Returns:
      The Set of Asset IDs
    • quantityMap

      public java.util.Map<java.lang.String,​java.lang.Double> quantityMap()
      Retrieve the Map of Holdings Amount
      Returns:
      The Map of Holdings Amount
    • add

      public boolean add​(java.lang.String assetID, double quantity)
      Add an Asset/Amount Pair
      Parameters:
      assetID - The Asset ID
      quantity - The Amount in the Portfolio
      Returns:
      TRUE - The Asset/Amount has been successfully added
    • contains

      public boolean contains​(java.lang.String assetID)
      Indicates if an Asset exists in the Holdings
      Parameters:
      assetID - The Asset ID
      Returns:
      TRUE - The Asset is Part of the Holdings (may have Zero Value though)
    • quantity

      public double quantity​(java.lang.String assetID) throws java.lang.Exception
      Retrieves the Holdings Quantity for the Asset (if it exists)
      Parameters:
      assetID - The Asset ID
      Returns:
      The Holdings Quantity for the Asset (if it exists)
      Throws:
      java.lang.Exception - Thrown if the Inputs are Invalid
    • currency

      public java.lang.String currency()
      Retrieve the Currency
      Returns:
      The Currency
    • cash

      public double cash()
      Retrieves the Cash Holdings
      Returns:
      The Cash Holdings
    • toArray

      public double[] toArray()
      Retrieve the Array Form of the Holdings Quantity
      Returns:
      Array Form of the Holdings Quantity
    • constrict

      public double[] constrict​(Holdings holdingsOther)
      Constrict "This" Holdings to those of the Assets in the "Other" Holdings
      Parameters:
      holdingsOther - The Other Holdings Instance
      Returns:
      Constriction of "This" Holdings