toString method

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string represetion.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.

Implementation

String toString() {
  return
      "ScripCode: "+ getScripCode() + "\n" +
      "LastTrade Price: " + _quotePacket.getLastTradedPrice().toString() + "\n" +
      "Close Price: " + _quotePacket.getClosePrice().toString() + "\n" +
      "TotalTradedQty: " + _quotePacket.getTotalTradedQty().toString() + "\n" +
      "HighPrice: " + _quotePacket.getHighPrice().toString() + "\n" +
      "LowPrice: " + _quotePacket.getLowPrice().toString() + "\n" +
      "OpenPrice: " + _quotePacket.getOpenPrice().toString() + "\n" +
      "WeightedAveragePrice: " + getWeightedAveragePrice().toString() + "\n" +
      "TotalBuy: " + getTotalBuy().toString() + "\n" +
      "TotalSell: " + getTotalSell().toString() + "\n" +
      "LowerCircuit: " + getLowerCircuit().toString() + "\n" +
      "UpperCircuit: " + getUpperCircuit().toString() + "\n" +
      "Timestamp: " + getTimestamp().toString() + "\n" +
      "LastTradedQty: " + getLastTradedQty().toString() + "\n" +
      "CurrentClosePrice: " + getCurrentClosePrice().toString() + "\n" +
      "Exchange: " + getExchange().toString();
}