Example usage for org.apache.commons.lang3.tuple Triple getLeft

List of usage examples for org.apache.commons.lang3.tuple Triple getLeft

Introduction

In this page you can find the example usage for org.apache.commons.lang3.tuple Triple getLeft.

Prototype

public abstract L getLeft();

Source Link

Document

Gets the left element from this triple.

Usage

From source file:storm.lrb.bolt.LastAverageSpeedBolt.java

private void emitLav(Triple<Integer, Integer, Integer> xsd, List<Integer> vehicleCounts,
        List<Double> speedValues, int minute) {

    double speedAverage = this.calcLav(speedValues, minute);
    int segmentCarCount = vehicleCounts.get(minute);

    this.collector.emit(new Values(xsd.getLeft(), xsd.getMiddle(), xsd.getRight(), segmentCarCount,
            speedAverage, minute + 1));/*ww w .j  a v a2 s.  c  om*/
}

From source file:urls.CurlStore.java

public Pair<String, InputStream> get() {
    final Triple<String, Process, Long> triple = QUEUE.poll();
    if (triple == null)
        return null;

    final Process process = triple.getMiddle();
    final Long startTime = triple.getRight();
    final String url = triple.getLeft();

    if (process.isAlive()) {
        if (System.currentTimeMillis() - startTime < timeout)
            QUEUE.offer(triple);/* w  w w  .j a  v  a 2  s  . c o  m*/
        else {
            process.destroy();
            EXIT_VALUES.append(". ");
        }
        return null;
    }

    if (process.exitValue() != 0) {
        EXIT_VALUES.append(process.exitValue() + " ");
        return null;
    }

    return Pair.of(url, process.getInputStream());
}