Example #1
0
 CompanyActionVO processDivident(String stockCode, PMDate date, String rawActionLine) {
   int st = rawActionLine.indexOf(DIV_STRING);
   if (st == -1) {
     return null;
   }
   String substring = rawActionLine.substring(st);
   NumberExtractor extractor = new NumberExtractor(substring);
   if (extractor.hasMoreElements()) {
     CompanyActionVO actionVO =
         new CompanyActionVO(
             COMPANY_ACTION_TYPE.Divident, date, stockCode, extractor.nextElement(), 1f);
     actionVO.setPercentageValue(extractor.isPercentage());
     st = extractor.getIndex();
     if (st < rawActionLine.length()) {
       int retVal = checkForAdditionalDivident(actionVO, substring.substring(st), SPL_STRING);
       if (retVal != -1) st = retVal;
       retVal = checkForAdditionalDivident(actionVO, substring.substring(st), INT_STRING);
       if (retVal != -1) st = retVal;
       st = getNextItem(substring, st); // check for items after /
       if (st != -1 && st < rawActionLine.length()) {
         checkForAdditionalDivident(actionVO, substring.substring(st), DIV_STRING);
       }
     }
     return actionVO;
   }
   return null;
 }