Exemplo n.º 1
0
  private boolean compareTimeLists(List<DateTime> timesA, List<DateTime> timesB) {
    if (timesA.size() != timesB.size()) return false;

    Collections.sort(timesA);
    Collections.sort(timesB);
    for (int i = 0; i < timesA.size(); i++) {
      DateTime a = timesA.get(i);
      DateTime b = timesB.get(i);

      double test = Math.abs(a.getValue() - b.getValue());
      if (test > 65.0) return false;
      // System.out.println("TTTTTTT =  " + test );
    }
    return true;
  }
Exemplo n.º 2
0
  /**
   * Create the list of times associated with this DataSource.
   *
   * @return list of times.
   */
  protected List doMakeDateTimes() {
    List times = new ArrayList();
    boolean isRealTime = isRealTime();
    List<RadarAdapter> adapters = getAdapters();
    for (int i = 0; i < adapters.size(); i++) {
      if (!isRealTime) {
        times.add(((RadarAdapter) adapters.get(i)).getBaseTime());
      } else {
        String name = i + "th most recent";
        if (i == 0) {
          name = "Most recent";
        }
        if ((i > 0) && (i < DataSource.ordinalNames.length)) {
          name = DataSource.ordinalNames[i] + " most recent";
        }
        times.add(new TwoFacedObject(name, i));
      }
    }
    Collections.sort(times);

    return times;
  }