@@ -0,0 +1,1301 @@
+package sssj.base;%0A%0Aimport java.util.Iterator;%0Aimport java.util.LinkedList;%0Aimport java.util.Queue;%0A%0Apublic class ResidualList implements Iterable%3CVector%3E %7B%0A  private Queue%3CVector%3E queue = new LinkedList%3C%3E();%0A%0A  public void add(Vector residual) %7B%0A    queue.add(residual);%0A  %7D%0A%0A  @Override%0A  public Iterator%3CVector%3E iterator() %7B%0A    return queue.iterator();%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    return %22ResidualList = %5B%22 + queue + %22%5D%22;%0A  %7D%0A%0A  // TODO should use a map for MiniBatch?%0A  public Vector get(long candidateID) %7B%0A    for (Vector v : queue)%0A      if (candidateID == v.timestamp())%0A        return v;%0A    return null;%0A  %7D%0A%0A  /**%0A   * Get the residual of the vector with id %7B@code candidateID%7D, while at the same time pruning all the residuals with timestamp less than %7B@code lowWatermark%7D.%0A   *%0A   * @param candidateID the id of the candidate vector%0A   * @param lowWatermark the minimum id of the vector to be retained%0A   * @return the residual of the candidate%0A   */%0A  public Vector getAndPrune(long candidateID, long lowWatermark) %7B%0A    for (Iterator%3CVector%3E it = queue.iterator(); it.hasNext();) %7B%0A      final Vector v = it.next();%0A      if (lowWatermark %3E v.timestamp())%0A        it.remove();%0A      if (candidateID == v.timestamp())%0A        return v;%0A    %7D%0A    return null;%0A  %7D%0A%7D

Add missing ResidualList class