hudson.util
Class RunList<R extends Run>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<R>
          extended by hudson.util.RunList<R>
All Implemented Interfaces:
Iterable<R>, Collection<R>, List<R>

public class RunList<R extends Run>
extends AbstractList<R>

List of Runs, sorted in the descending date order.

Author:
Kohsuke Kawaguchi

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
RunList()
           
RunList(Collection<? extends Job> jobs)
           
RunList(Job j)
           
RunList(View view)
           
 
Method Summary
 RunList<R> byTimestamp(long start, long end)
          Filter the list by timestamp.
 RunList<R> failureOnly()
          Filter the list to non-successful builds only.
static
<R extends Run>
RunList<R>
fromRuns(Collection<? extends R> runs)
           
 R get(int index)
          Deprecated. as of 1.485 RunList, despite its name, should be really used as Iterable, not as List.
 R getFirstBuild()
           
 R getLastBuild()
           
 int indexOf(Object o)
           
 boolean isEmpty()
           
 Iterator<R> iterator()
           
 int lastIndexOf(Object o)
           
 RunList<R> limit(int n)
           
 RunList<R> newBuilds()
          Reduce the size of the list by only leaving relatively new ones.
 RunList<R> node(Node node)
          Filter the list to builds on a single node only
 RunList<R> regressionOnly()
          Filter the list to regression builds only.
 int size()
          Deprecated. as of 1.485 RunList, despite its name, should be really used as Iterable, not as List.
 List<R> subList(int fromIndex, int toIndex)
          AbstractList.subList(int, int) isn't very efficient on our Iterable based implementation.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, listIterator, listIterator, remove, removeRange, set
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

RunList

public RunList()

RunList

public RunList(Job j)

RunList

public RunList(View view)

RunList

public RunList(Collection<? extends Job> jobs)
Method Detail

iterator

public Iterator<R> iterator()
Specified by:
iterator in interface Iterable<R extends Run>
Specified by:
iterator in interface Collection<R extends Run>
Specified by:
iterator in interface List<R extends Run>
Overrides:
iterator in class AbstractList<R extends Run>

size

public int size()
Deprecated. as of 1.485 RunList, despite its name, should be really used as Iterable, not as List.

Specified by:
size in interface Collection<R extends Run>
Specified by:
size in interface List<R extends Run>
Specified by:
size in class AbstractCollection<R extends Run>

get

public R get(int index)
Deprecated. as of 1.485 RunList, despite its name, should be really used as Iterable, not as List.

Specified by:
get in interface List<R extends Run>
Specified by:
get in class AbstractList<R extends Run>

subList

public List<R> subList(int fromIndex,
                       int toIndex)
AbstractList.subList(int, int) isn't very efficient on our Iterable based implementation. In fact the range check alone would require us to iterate all the elements, so we'd be better off just copying into ArrayList.

Specified by:
subList in interface List<R extends Run>
Overrides:
subList in class AbstractList<R extends Run>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<R extends Run>
Overrides:
indexOf in class AbstractList<R extends Run>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<R extends Run>
Overrides:
lastIndexOf in class AbstractList<R extends Run>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<R extends Run>
Specified by:
isEmpty in interface List<R extends Run>
Overrides:
isEmpty in class AbstractCollection<R extends Run>

getFirstBuild

public R getFirstBuild()

getLastBuild

public R getLastBuild()

fromRuns

public static <R extends Run> RunList<R> fromRuns(Collection<? extends R> runs)

limit

public RunList<R> limit(int n)

failureOnly

public RunList<R> failureOnly()
Filter the list to non-successful builds only.


node

public RunList<R> node(Node node)
Filter the list to builds on a single node only


regressionOnly

public RunList<R> regressionOnly()
Filter the list to regression builds only.


byTimestamp

public RunList<R> byTimestamp(long start,
                              long end)
Filter the list by timestamp. s&lt=;e.


newBuilds

public RunList<R> newBuilds()
Reduce the size of the list by only leaving relatively new ones. This also removes on-going builds, as RSS cannot be used to publish information if it changes.



Copyright © 2004-2013. All Rights Reserved.