All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thanglequoc.aqicalculator.Index Maven / Gradle / Ivy

Go to download

AQI Calculator give the detail result from AQI calculation. It also supports NowCast

The newest version!
package com.thanglequoc.aqicalculator;

import com.fasterxml.jackson.databind.JsonNode;

/**
 * Represent upper bound index (I-high) and lower bound
 * index (I-low) of a corresponding range in
 * PollutantBreakpoint of a pollutant
 *
 * @author ThangLeQuoc
 */
class Index {
    
    private int min;
    private int max;
    
    Index(int min, int max) {
        this.min = min;
        this.max = max;
    }
    
    int getMinIndex() {
        return min;
    }
    
    int getMaxIndex() {
        return max;
    }
    
    static Index fromIndexNode(JsonNode indexNode) {
        int minIndex = indexNode.path(AQICalculatorConstants.MIN).asInt();
        int maxIndex = indexNode.path(AQICalculatorConstants.MAX).asInt();
        return new Index(minIndex, maxIndex);
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy