/** * Filter the list by timestamp. * * {@code s<=;e}. */ public RunList<R> byTimestamp(long start, long end) { AbstractList<Long> TIMESTAMP_ADAPTER = new AbstractList<Long>() { public Long get(int index) { return RunList.this.get(index).getTimeInMillis(); } public int size() { return RunList.this.size(); } }; Comparator<Long> DESCENDING_ORDER = new Comparator<Long>() { public int compare(Long o1, Long o2) { if (o1 > o2) return -1; if (o1 < o2) return +1; return 0; } }; int s = Collections.binarySearch(TIMESTAMP_ADAPTER, start, DESCENDING_ORDER); if (s<0) s=-(s+1); // min is inclusive int e = Collections.binarySearch(TIMESTAMP_ADAPTER, end, DESCENDING_ORDER); if (e<0) e=-(e+1); else e++; // max is exclusive, so the exact match should be excluded return fromRuns(subList(e,s)); }
/** * Filter the list by timestamp. * * {@code s<=;e}. */ public RunList<R> byTimestamp(long start, long end) { AbstractList<Long> TIMESTAMP_ADAPTER = new AbstractList<Long>() { public Long get(int index) { return RunList.this.get(index).getTimeInMillis(); } public int size() { return RunList.this.size(); } }; Comparator<Long> DESCENDING_ORDER = new Comparator<Long>() { public int compare(Long o1, Long o2) { if (o1 > o2) return -1; if (o1 < o2) return +1; return 0; } }; int s = Collections.binarySearch(TIMESTAMP_ADAPTER, start, DESCENDING_ORDER); if (s<0) s=-(s+1); // min is inclusive int e = Collections.binarySearch(TIMESTAMP_ADAPTER, end, DESCENDING_ORDER); if (e<0) e=-(e+1); else e++; // max is exclusive, so the exact match should be excluded return fromRuns(subList(e,s)); }
/** * Filter the list by timestamp. * * {@code s<=;e}. */ public RunList<R> byTimestamp(long start, long end) { AbstractList<Long> TIMESTAMP_ADAPTER = new AbstractList<Long>() { public Long get(int index) { return RunList.this.get(index).getTimeInMillis(); } public int size() { return RunList.this.size(); } }; Comparator<Long> DESCENDING_ORDER = new Comparator<Long>() { public int compare(Long o1, Long o2) { if (o1 > o2) return -1; if (o1 < o2) return +1; return 0; } }; int s = Collections.binarySearch(TIMESTAMP_ADAPTER, start, DESCENDING_ORDER); if (s<0) s=-(s+1); // min is inclusive int e = Collections.binarySearch(TIMESTAMP_ADAPTER, end, DESCENDING_ORDER); if (e<0) e=-(e+1); else e++; // max is exclusive, so the exact match should be excluded return fromRuns(subList(e,s)); }
return fromRuns(subList(e, s));
public List<TestResult> getList(int start, int end) { List<TestResult> list = new ArrayList<TestResult>(); end = Math.min(end, testObject.getOwner().getParent().getBuilds().size()); for (AbstractBuild<?,?> b: testObject.getOwner().getParent().getBuilds().subList(start, end)) { if (b.isBuilding()) continue; TestResult o = testObject.getResultInBuild(b); if (o != null) { list.add(o); } } return list; }
public List<TestResult> getList(int start, int end) { List<TestResult> list = new ArrayList<TestResult>(); end = Math.min(end, testObject.getOwner().getParent().getBuilds().size()); for (AbstractBuild<?,?> b: testObject.getOwner().getParent().getBuilds().subList(start, end)) { if (b.isBuilding()) continue; TestResult o = testObject.getResultInBuild(b); if (o != null) { list.add(o); } } return list; }
public List<TestResult> getList(int start, int end) { List<TestResult> list = new ArrayList<TestResult>(); end = Math.min(end, testObject.getRun().getParent().getBuilds().size()); for (Run<?,?> b: testObject.getRun().getParent().getBuilds().subList(start, end)) { if (b.isBuilding()) continue; TestResult o = testObject.getResultInRun(b); if (o != null) { list.add(o); } } return list; }
public List<TestResult> getList(int start, int end) { List<TestResult> list = new ArrayList<TestResult>(); end = Math.min(end, testObject.getOwner().getParent().getBuilds().size()); for (AbstractBuild<?, ?> b : testObject.getOwner().getParent().getBuilds().subList(start, end)) { if (b.isBuilding()) { continue; } TestResult o = testObject.getResultInBuild(b); if (o != null) { list.add(o); } } return list; }
public List<TestResult> getList(int start, int end) { List<TestResult> list = new ArrayList<TestResult>(); end = Math.min(end, testObject.getOwner().getParent().getBuilds().size()); for (AbstractBuild<?, ?> b : testObject.getOwner().getParent().getBuilds().subList(start, end)) { if (b.isBuilding()) { continue; } TestResult o = testObject.getResultInBuild(b); if (o != null) { list.add(o); } } return list; }