void add(long key, Index index) { if (stdOut.start < 0) { stdOut.start = index.stdOut.start; } if (stdErr.start < 0) { stdErr.start = index.stdErr.start; } if (index.stdOut.stop > stdOut.stop) { stdOut.stop = index.stdOut.stop; } if (index.stdErr.stop > stdErr.stop) { stdErr.stop = index.stdErr.stop; } children.put(key, index); }
/** * If {@link Network.Mode} == {@link Mode#AUTO}, calling this method will start the main engine * thread which pulls in data from the connected {@link Sensor}(s). * * <p><em>Warning:</em> Calling this method with any other Mode than {@link Mode#AUTO} will result * in an {@link UnsupportedOperationException} being thrown. */ public void start() { if (regions.size() < 1) { throw new IllegalStateException("Nothing to start - 0 regions"); } Region tail = regions.get(0); Region upstream = tail; while ((upstream = upstream.getUpstreamRegion()) != null) { tail = upstream; } tail.start(); }
private void mark(long classId, long testId, boolean isStdout) { if (!index.containsKey(classId)) { index.put(classId, new LinkedHashMap<Long, TestCaseRegion>()); } Map<Long, TestCaseRegion> testCaseRegions = index.get(classId); if (!testCaseRegions.containsKey(testId)) { TestCaseRegion region = new TestCaseRegion(); testCaseRegions.put(testId, region); } TestCaseRegion region = testCaseRegions.get(testId); Region streamRegion = isStdout ? region.stdOutRegion : region.stdErrRegion; int total = output.total(); if (streamRegion.start < 0) { streamRegion.start = total; } streamRegion.stop = total; }