Ejemplo n.º 1
0
  /** Returns the oldest build in the record. */
  @Exported
  @QuickSilver
  public RunT getFirstBuild() {
    SortedMap<Integer, ? extends RunT> runs = _getRuns();

    if (runs.isEmpty()) return null;
    return runs.get(runs.lastKey());
  }
Ejemplo n.º 2
0
 /**
  * Gets the latest build #m that satisfies <tt>m&lt;=n</tt>.
  *
  * <p>This is useful when you'd like to fetch a build but the exact build might be already gone
  * (deleted, rotated, etc.)
  */
 public final RunT getNearestOldBuild(int n) {
   SortedMap<Integer, ? extends RunT> m = _getRuns().tailMap(n);
   if (m.isEmpty()) return null;
   return m.get(m.firstKey());
 }
Ejemplo n.º 3
0
 /**
  * Gets the youngest build #m that satisfies <tt>n&lt;=m</tt>.
  *
  * <p>This is useful when you'd like to fetch a build but the exact build might be already gone
  * (deleted, rotated, etc.)
  */
 public final RunT getNearestBuild(int n) {
   SortedMap<Integer, ? extends RunT> m = _getRuns().headMap(n - 1); // the map should
   // include n, so n-1
   if (m.isEmpty()) return null;
   return m.get(m.lastKey());
 }