Example #1
0
  /**
   * Removes the Entry object at the given xIndex from the DataSet at the specified index. Returns
   * true if an Entry was removed, false if no Entry was found that meets the specified
   * requirements.
   *
   * @param xIndex
   * @param dataSetIndex
   * @return
   */
  public boolean removeEntry(int xIndex, int dataSetIndex) {

    if (dataSetIndex >= mDataSets.size()) return false;

    T dataSet = mDataSets.get(dataSetIndex);
    Entry e = dataSet.getEntryForXIndex(xIndex);

    return removeEntry(e, dataSetIndex);
  }
Example #2
0
  /**
   * Returns the DataSet that contains the provided Entry, or null, if no DataSet contains this
   * Entry.
   *
   * @param e
   * @return
   */
  public T getDataSetForEntry(Entry e) {

    if (e == null) return null;

    for (int i = 0; i < mDataSets.size(); i++) {

      T set = mDataSets.get(i);

      for (int j = 0; j < set.getEntryCount(); j++) {
        if (e.equalTo(set.getEntryForXIndex(e.getXIndex()))) return set;
      }
    }

    return null;
  }