protected Integer extractPreviousRank( Stock stock, String analysisName, Date endDate, EventType... eventTypes) throws IgnoredEventDateException { EventValue previousEventValue = DataSource.getInstance().getLastTrendEventFor(stock, analysisName, endDate, eventTypes); if (previousEventValue == null) return null; Calendar currentDateCal = Calendar.getInstance(); currentDateCal.setTime(endDate); currentDateCal.set(Calendar.HOUR_OF_DAY, 0); currentDateCal.set(Calendar.MINUTE, 0); currentDateCal.set(Calendar.SECOND, 0); currentDateCal.set(Calendar.MILLISECOND, 0); if (previousEventValue.getDate().compareTo(currentDateCal.getTime()) == 0) throw new IgnoredEventDateException(previousEventValue); Integer previousRank = extractPreviousRankFromMessage(previousEventValue); return previousRank; }
public Date getFirstQuotationDateFromQuotations(Stock stock) { return DataSource.getInstance().getFirstQuotationDateFromQuotations(stock); }