Example usage for java.lang Integer MIN_VALUE

List of usage examples for java.lang Integer MIN_VALUE

Introduction

In this page you can find the example usage for java.lang Integer MIN_VALUE.

Prototype

int MIN_VALUE

To view the source code for java.lang Integer MIN_VALUE.

Click Source Link

Document

A constant holding the minimum value an int can have, -231.

Usage

From source file:mase.me.MEFinalRepertoireTextStat.java

protected String toString2D(MESubpopulation sub) {
    StringBuilder sb = new StringBuilder();

    // find the bounds of the repertoire
    Collection<int[]> values = new ArrayList<>(sub.inverseHash.values());
    int min0 = Integer.MAX_VALUE, min1 = Integer.MAX_VALUE, max0 = Integer.MIN_VALUE, max1 = Integer.MIN_VALUE;
    for (int[] v : values) {
        min0 = Math.min(min0, v[0]);
        max0 = Math.max(max0, v[0]);
        min1 = Math.min(min1, v[1]);
        max1 = Math.max(max1, v[1]);
    }/*from   ww w .jav a  2s .c o  m*/

    // print repertoire
    int pad = Math.max(Integer.toString(min1).length(), Integer.toString(max1).length());
    sb.append(StringUtils.repeat(' ', pad)).append("y\n");
    for (int i1 = max1; i1 >= min1; i1--) {
        sb.append(StringUtils.leftPad(i1 + "", pad)).append("|");
        for (int i0 = min0; i0 <= max0; i0++) {
            int h = sub.hash(new int[] { i0, i1 });
            if (sub.map.containsKey(h)) {
                sb.append("[]");
            } else {
                sb.append("  ");
            }
        }
        sb.append("\n");
    }

    // x-axis lines
    sb.append(StringUtils.repeat(' ', pad)).append('-');
    for (int i0 = min0; i0 <= max0; i0++) {
        sb.append("--");
    }
    sb.append(" x\n");

    // x-axis numbers
    sb.append(StringUtils.repeat(' ', pad + 1));
    int longest = Math.max(Integer.toString(min0).length(), Integer.toString(max0).length());
    int space = (longest + 2) / 2 * 2;
    int order = 0;
    for (int i0 = min0; i0 <= max0; i0++) {
        String s = Integer.toString(i0);
        if (order % (space / 2) == 0) {
            sb.append(StringUtils.rightPad(s, space));
        }
        order++;
    }
    sb.append('\n');
    return sb.toString();
}

From source file:edu.ku.brc.specify.toycode.mexconabio.AgentNames.java

/**
 * // w w w .j  a v  a2s . com
 */
public void process() {
    //String sql = "SELECT collector_name FROM raw WHERE collector_name IS NOT NULL AND collector_name LIKE '%;%' limit 4000,1000";
    String sql = "SELECT collector_name FROM raw WHERE collector_name IS NOT NULL limit 4000,1000";
    try {
        Statement stmt = oldDBConn.createStatement(ResultSet.FETCH_FORWARD, ResultSet.CONCUR_READ_ONLY);
        stmt.setFetchSize(Integer.MIN_VALUE);

        ResultSet rs = stmt.executeQuery(sql);
        while (rs.next()) {
            String str = rs.getString(1);
            System.out.println("\n" + str);
            parseForNames(str);
        }
        rs.close();
        stmt.close();

    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

From source file:com.redhat.lightblue.metadata.types.IntegerTypeTest.java

@Test
public void testCompareNotEqual() {
    assertEquals(integerType.compare((Object) Integer.MAX_VALUE, (Object) Integer.MIN_VALUE), 1);
}

From source file:com.obergner.hzserver.ServerInfo.java

@Override
public int getPhase() {
    return Integer.MIN_VALUE + 1000;
}

From source file:com.salesmanager.core.entity.catalog.CategoryDescription.java

/**
 * Set the unique identifier of this class
 * /*  w  w  w  .  j a v  a 2s .c  o  m*/
 * @param id
 *            the new ID
 */
public void setId(com.salesmanager.core.entity.catalog.CategoryDescriptionId id) {
    this.id = id;
    this.hashCode = Integer.MIN_VALUE;
}

From source file:com.luan.thermospy.server.core.ThermospyController.java

public void stop() {
    camera.stop();
    temperature = Integer.MIN_VALUE;

}

From source file:com.sisrni.managedbean.NoticiaMB.java

public void guardarNoticia() {
    try {/* w  w  w. ja va2  s .  co m*/
        noticia.setIdNoticia(Integer.MIN_VALUE);
        noticia.setFechaNoticia(new Date());
        noticia.setIdCategoria(categoriaNoticiaService.findById(categoriaSelected.getIdCategoria()));
        noticiaService.save(noticia);
        if (publicarEnFacebook) {
            publicarNoticiaEnFb();
        }
        inicializador();
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,
                "Exito!", "La Informacion se ha registrado correctamente!"));
        //globalCounter.increment(noticiasNoVisibles());
    } catch (Exception e) {
        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR,
                "Error!", "La Informacion no ha sido registrada."));

    }
}

From source file:za.org.opengov.stockout.service.impl.StockoutServiceImpl.java

/**
 * {@inheritDoc}/*from   w  w w. j av a2  s  .com*/
 */
@Override
public void updateAllStockoutPriorities() {

    List<Stockout> stockouts = dao.findAll();

    int minSev, maxSev, minOcc, maxOcc, minDur, maxDur;
    minSev = Integer.MAX_VALUE;
    minOcc = Integer.MAX_VALUE;
    minDur = Integer.MAX_VALUE;

    maxSev = Integer.MIN_VALUE;
    maxOcc = Integer.MIN_VALUE;
    maxDur = Integer.MIN_VALUE;

    // determine max and min severity, occurances & duration
    for (Stockout stockout : stockouts) {

        // stockouts which haven't been assigned as an issue must be ignored
        if (stockout.getIssue() != null) {

            int severity = stockout.getIssue().getSeverity();
            int occurances = stockout.getStockoutReports().size();
            DateTime stockoutDate = new DateTime(stockout.getIssue().getStartTimestamp());
            int duration = Days.daysBetween(stockoutDate, DateTime.now()).getDays();

            if (severity < minSev) {
                minSev = severity;
            }
            if (severity > maxSev) {
                maxSev = severity;
            }
            if (occurances < minOcc) {
                minOcc = occurances;
            }
            if (occurances > maxOcc) {
                maxOcc = occurances;
            }
            if (duration < minDur) {
                minDur = duration;
            }
            if (duration > maxDur) {
                maxDur = duration;
            }
        }
    }

    // assign priorities
    for (Stockout stockout : stockouts) {
        // stockouts which haven't been assigned as an issue must be ignored
        if (stockout.getIssue() != null) {

            int severity = stockout.getIssue().getSeverity();
            int occurances = stockout.getStockoutReports().size();
            DateTime stockoutDate = new DateTime(stockout.getIssue().getStartTimestamp());
            int duration = Days.daysBetween(stockoutDate, DateTime.now()).getDays();

            int priority = issueService.calculatePriority(severity, occurances, duration, minSev, minOcc,
                    minDur, maxSev, maxOcc, maxDur);

            stockout.getIssue().setPriority(priority);
            issueService.put(stockout.getIssue());

        }
    }
}

From source file:com.jillesvangurp.geo.GeoGeometry.java

/**
 * @param polygon 3d polygon array/*w ww.  ja v a2 s .com*/
 * @return bounding box that contains the polygon as a double array of
 *         [minLat,maxLat,minLon,maxLon}
 */
public static double[] boundingBox(double[][][] polygon) {
    double minLat = Integer.MAX_VALUE;
    double minLon = Integer.MAX_VALUE;
    double maxLat = Integer.MIN_VALUE;
    double maxLon = Integer.MIN_VALUE;
    for (int i = 0; i < polygon.length; i++) {
        for (int j = 0; j < polygon[i].length; j++) {
            minLat = min(minLat, polygon[i][j][1]);
            minLon = min(minLon, polygon[i][j][0]);
            maxLat = max(maxLat, polygon[i][j][1]);
            maxLon = max(maxLon, polygon[i][j][0]);
        }
    }
    return new double[] { minLat, maxLat, minLon, maxLon };
}

From source file:eu.markov.jenkins.plugin.mvnmeta.MavenMetadataParameterDefinition.java

public int getMaxVers() {
    if (this.maxVers == Integer.MIN_VALUE) {
        int maxVers = Integer.MAX_VALUE;
        try {/*from  w  ww . j  av a 2  s .  com*/
            maxVers = Integer.parseInt(maxVersions);
        } catch (NumberFormatException e) {
        }
        this.maxVers = maxVers;
    }
    return this.maxVers;
}