Obtains all the {@link Run}s whose build numbers matches the given {@link RangeSet}.
509445
public synchronized List<RunT> getBuilds(RangeSet rs) {
        List<RunT> builds = new LinkedList<>();

        for (Range r : rs.getRanges()) {
            for (RunT b = getNearestBuild(r.start); b!=null && b.getNumber()<r.end; b=b.getNextBuild()) {
                builds.add(b);
            }
        }

        return builds;
    }
1003726
public SequencalJobExecuteResults runAll() {
        SequencalJobExecuteResults results = new SequencalJobExecuteResults();
        for (Job job : jobs) {
            job.setJarByClass(SequencalJobChain.class);
            try {
                boolean isSuccessful = job.waitForCompletion(true);
                results.add(new SequencalJobExecuteResult(isSuccessful, job.getJobName()));
                if (!isSuccessful) {
                    break;
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return results;
    }
744063
void collectRangeVariables(RangeVariable[] rangeVariables, Set set) {

        for (int i = 0; i < nodes.length; i++) {
            if (nodes[i] != null) {
                nodes[i].collectRangeVariables(rangeVariables, set);
            }
        }

        if (subQuery != null && subQuery.queryExpression != null) {
            HsqlList unresolvedExpressions =
                subQuery.queryExpression.getUnresolvedExpressions();

            if (unresolvedExpressions != null) {
                for (int i = 0; i < unresolvedExpressions.size(); i++) {
                    Expression e = (Expression) unresolvedExpressions.get(i);

                    e.collectRangeVariables(rangeVariables, set);
                }
            }
        }
    }
1097384
public static RunSet readRunSet(final InputStream inputStream) throws IOException {
        checkNotNull(inputStream);
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
            return readRunSet(reader);
        }
    }
128952
public RunT getNearestOldBuild(int n) {
        SortedMap<Integer, ? extends RunT> m = _getRuns().tailMap(n);
        if (m.isEmpty())
            return null;
        return m.get(m.firstKey());
    }
437259
public List<ResidueRangeAndLength> getRanges() {
		String currentChain = "";
		ResidueNumber first = null;
		ResidueNumber prev = null;
		List<ResidueRangeAndLength> ranges = new ArrayList<ResidueRangeAndLength>();
		for (ResidueNumber rn : treeMap.keySet()) {
			if (!rn.getChainName().equals(currentChain)) {
				if (first != null) {
					ResidueRangeAndLength newRange = new ResidueRangeAndLength(currentChain, first, prev, this.getLength(first, prev));
					ranges.add(newRange);
				}
				first = rn;
			}
			prev = rn;
			currentChain = rn.getChainName();
		}
		ResidueRangeAndLength newRange = new ResidueRangeAndLength(currentChain, first, prev, this.getLength(first, prev));
		ranges.add(newRange);
		return ranges;
	}
248356
private Run<?,?> find(Run<?,?> b) {
        for ( ; b!=null && !apply(b); b=b.getPreviousBuild())
            ;
        return b;
    }
367186
public RunList<R> completedOnly() {
        return filter(new Predicate<R>() {
            public boolean apply(R r) {
                return !r.isBuilding();
            }
        });
    }
1109648
def result
      result = []

      @ranges.each do |r|

        if r.instance_of?(Fixnum) || r.instance_of?(String)
          result << _result(r.to_s)
          next
        end

        unless r.instance_of?(Range)
          @logger.error("Illigal number #{r}")
          next
        end

        r.each do |n|
          runner = _result(n.to_s)
          unless runner.nil?
            result << runner
          end
        end
      end

      return result.compact
    end
385300
public static List<String> getBuildNumbersNotToBeDeleted(Run build) {
        List<String> notToDelete = Lists.newArrayList();
        List<? extends Run<?, ?>> builds = build.getParent().getBuilds();
        for (Run<?, ?> run : builds) {
            if (run.isKeepLog()) {
                notToDelete.add(String.valueOf(run.getNumber()));
            }
        }
        return notToDelete;
    }
411979
def updaten(self, rangesets):
        
        for rng in rangesets:
            if isinstance(rng, set):
                self.update(rng)
            else:
                self.update(RangeSet(rng))
1202269
public Set<GraphObject> run()
	{
		// result set of neighborhood query
		Set<GraphObject> queryResult = new HashSet<GraphObject>();

		// if upstream is selected
		if (direction == Direction.UPSTREAM || direction == Direction.BOTHSTREAM)
		{
			// run BFS in upstream direction
			BFS bfsBackward = new BFS(sourceNodes, null, Direction.UPSTREAM, this.limit);

			/*
	  Maps to hold forward and backward BFS results
	 */
			Map<GraphObject, Integer> mapBackward = bfsBackward.run();

			// add result of BFS to result Set
			queryResult.addAll(mapBackward.keySet());
		}

		// if downstream is selected
		if (direction == Direction.DOWNSTREAM || direction == Direction.BOTHSTREAM)
		{
			// run BFS in downstream direction
			BFS bfsForward = new BFS(sourceNodes, null, Direction.DOWNSTREAM, this.limit);

			Map<GraphObject, Integer> mapForward = bfsForward.run();

			// add result of BFS to result Set
			queryResult.addAll(mapForward.keySet());
		}
		
		// return the result of query
		return queryResult;
	}
439788
public Mutations<S> removeMutationsInRanges(Range... ranges) {
        Mutations<S> result = this;
        int offset = 0;
        int lastTo = 0;
        for (Range range : ranges) {
            if (range.getFrom() < lastTo)
                throw new IllegalArgumentException("Ranges are not sorted.");
            result = result.removeMutationsInRange(range.move(offset));
            offset -= range.length();
            lastTo = range.getTo();
        }
        return result;
    }
1150098
public List<RunT> getLastBuildsOverThreshold(int numberOfBuilds, Result threshold) {
        
        List<RunT> result = new ArrayList<>(numberOfBuilds);
        
        RunT r = getLastBuild();
        while (r != null && result.size() < numberOfBuilds) {
            if (!r.isBuilding() && 
                 (r.getResult() != null && r.getResult().isBetterOrEqualTo(threshold))) {
                result.add(r);
            }
            r = r.getPreviousBuild();
        }
        
        return result;
    }
213123
public IntStream getAllOccurrencesAsRanges() {
        IntStream result = IntStream.empty();
        // with/or without end
        for (int i = start; i < end; i++) {
            // every i is one occurrence
            int token_position = tokenIndex.suffix_array[i];
            IntStream range = IntStream.range(token_position, token_position + length);
            result = IntStream.concat(result, range);
        }
        return result;
    }
795287
public static Protos.Resource ranges(String name, String role, Protos.Value.Range... ranges) {
		checkNotNull(name);
		checkNotNull(role);
		checkNotNull(ranges);
		return Protos.Resource.newBuilder()
			.setName(name)
			.setType(Protos.Value.Type.RANGES)
			.setRanges(Protos.Value.Ranges.newBuilder().addAllRange(Arrays.asList(ranges)).build())
			.setRole(role)
			.build();
	}
6580
public static <T extends Comparable<T>> RangeSet<T> unionRanges(final Iterable<Range<T>> ranges)
  {
    RangeSet<T> rangeSet = null;
    for (Range<T> range : ranges) {
      if (rangeSet == null) {
        rangeSet = TreeRangeSet.create();
      }
      rangeSet.add(range);
    }
    return rangeSet;
  }