private void setDependees(TimeSeries ts) {
    ts.getDependees().clear();
    for (int i = 0; i < mSeries.size(); i++) {
      TimeSeries dependee = getSeries(i);
      if (ts == null || dependee == null || ts == dependee) continue;

      if (dependee.getDbRow().getSynthetic() == true) {
        Formula formula = mFormulaCache.getFormula(dependee.getDbRow().getId());
        ArrayList<String> names = formula.getDependentNames();

        if (names != null && names.contains(ts.getDbRow().getCategoryName()))
          ts.addDependee(dependee);
      }
    }

    return;
  }
  private void setDependents(TimeSeries synth) {
    if (synth.getDbRow().getSynthetic() == false) return;

    Formula formula = mFormulaCache.getFormula(synth.getDbRow().getId());
    ArrayList<String> names = formula.getDependentNames();
    if (names == null) return;

    synth.getDependents().clear();
    for (int i = 0; i < mSeries.size(); i++) {
      TimeSeries ts = mSeries.get(i);
      if (ts == null || ts == synth) continue;

      if (names.contains(ts.getDbRow().getCategoryName())) synth.addDependent(ts);
    }

    return;
  }