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:com.espertech.esper.support.view.SupportStreamImpl.java

public Object get(long index) {
    if ((index > Integer.MAX_VALUE) || (index < Integer.MIN_VALUE)) {
        throw new IllegalArgumentException("Index not within int range supported by this implementation");
    }/*from   w  w w  .  ja v a2 s .com*/
    return events.get((int) index);
}

From source file:ml.shifu.shifu.container.DtScore.java

public Object getMostFavoriateModelTarget() {
    if (modelTargetVoteMap == null || modelTargetVoteMap.size() == 0) {
        return null;
    }/*from  www  .  j  a  va2  s.c  o  m*/

    Object mostFavoriateTarget = null;
    int mostVoteCnt = Integer.MIN_VALUE;

    Iterator<Entry<Object, Integer>> iterator = modelTargetVoteMap.entrySet().iterator();
    while (iterator.hasNext()) {
        Entry<Object, Integer> entry = iterator.next();
        if (entry.getValue() > mostVoteCnt) {
            mostVoteCnt = entry.getValue();
            mostFavoriateTarget = entry.getKey();
        }
    }

    return mostFavoriateTarget;
}

From source file:ArrayUtil.java

public static int max(int[] d) {
    int max = Integer.MIN_VALUE;
    for (int i = 0; i < d.length; i++)
        if (d[i] > max)
            max = d[i];/*from w  ww.  j  a  v  a  2 s  .co  m*/
    return max;
}

From source file:com.haulmont.chile.core.datatypes.impl.IntegerDatatype.java

protected boolean hasValidIntegerRange(Number result) throws ParseException {
    if (result instanceof Long) {
        Long longResult = (Long) result;

        if (longResult > Integer.MAX_VALUE || longResult < Integer.MIN_VALUE) {
            return false;
        }// w  ww. ja  va 2 s .  c om
    } else {
        Double doubleResult = (Double) result;
        if (doubleResult > Integer.MAX_VALUE || doubleResult < Integer.MIN_VALUE) {
            return false;
        }
    }
    return true;
}

From source file:com.google.code.pentahoflashcharts.charts.BarLineChartFactory.java

@SuppressWarnings("unchecked")
public MinMax getRangeMinMax() {
    int rangeMin = 0;
    int rangeMax = 0;
    if (isstacked) {
        rangeMin = 0;/*from  www  . ja  v  a 2s.c om*/
        rangeMax = getStackedMaxRange();
    } else {
        rangeMin = Integer.MAX_VALUE;
        rangeMax = Integer.MIN_VALUE;
        List nodes = chartNode.selectNodes(BAR_SERIES_SERIES_NODE_LOC);
        List<String> bars = new ArrayList<String>();
        for (Object node : nodes) {
            if (getValue((Node) node) != null) {
                bars.add(getValue((Node) node));
            }
        }

        for (int c = 0; c < getColumnCount(); c++) {
            String text = getColumnHeader(c);
            if (bars.contains(text)) {
                for (int r = 0; r < getRowCount(); r++) {
                    if (rangeMin > ((Number) getValueAt(r, c)).intValue())
                        rangeMin = ((Number) getValueAt(r, c)).intValue();
                    if (rangeMax < ((Number) getValueAt(r, c)).intValue())
                        rangeMax = ((Number) getValueAt(r, c)).intValue();
                }
            }
        }
    }

    if (rangeMin > 0) {
        rangeMin = 0;
    }

    return new MinMax(rangeMin, rangeMax);
}

From source file:gov.nih.nci.cabig.caaers.dao.index.AbstractIndexDao.java

public int findAssociatedRole(String loginId, Integer entityId) {
    final int[] roleValue = new int[] { 0 };
    StringBuffer sb = new StringBuffer("select role from ").append(indexTableName())
            .append(" where login_id = '").append(loginId).append("' and (").append(entityIdColumnName())
            .append(" = ").append(String.valueOf(entityId));
    if (entityId > Integer.MIN_VALUE) {
        sb.append(" or ").append(entityIdColumnName()).append(" = ").append(Integer.MIN_VALUE);
    }//w  w  w  . j a  v  a  2 s  .co  m
    sb.append(")");

    getJdbcTemplate().query(sb.toString(), new RowMapper() {
        public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
            roleValue[0] |= rs.getInt(1);
            return null;
        }
    });
    return roleValue[0];
}

From source file:com.mongosqlmigrator.harsha.sql.DocBuilder.java

public void execute() throws Exception {

    String url = importer.getConfig().dataSources.get(null).getProperty("url");
    String user = importer.getConfig().dataSources.get(null).getProperty("user");
    String password = importer.getConfig().dataSources.get(null).getProperty("password");
    batchSize = Integer.valueOf(importer.getConfig().dataSources.get(null).getProperty("batch-size"));
    Entity rootEntity = importer.getConfig().document.entities.get(0);
    String driverName = importer.getConfig().dataSources.get(null).getProperty(DRIVER);

    //Set the fetch size depending on SQL type
    if (batchSize == -1 && driverName.contains("mysql"))
        batchSize = Integer.MIN_VALUE;
    else if (batchSize == -1)
        batchSize = 0;//from www  . ja v  a2s.c  om

    Class.forName(driverName).newInstance();
    conn = DriverManager.getConnection(url, user, password);
    subConnection = DriverManager.getConnection(url, user, password);

    //set the PK for future use
    importer.getWriter().setPrimaryKey(rootEntity.pk);

    if (rootEntity != null && rootEntity.isDocRoot) {
        String rootQuery = rootEntity.allAttributes.get("query");
        stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        stmt.setMaxRows(0);
        stmt.setFetchSize(batchSize);
        rs = stmt.executeQuery(rootQuery);
        int i = 0;
        List<Map<String, Object>> entityList = new ArrayList<Map<String, Object>>();
        long t1 = System.currentTimeMillis();

        while (rs.next()) {
            if (i == importer.getAutoCommitSize()) {
                long t2 = System.currentTimeMillis();
                log.info("Time taken to Read " + i + " documents from SQL : " + (t2 - t1) + " ms");
                importer.getWriter().writeToNoSQL(entityList);
                entityList = new ArrayList<Map<String, Object>>();
                i = 0;
                t1 = System.currentTimeMillis();
            }
            params = new HashMap<String, String>();
            entityList.add(getFields(processor.toMap(rs), rs, rootEntity, null, null));
            i++;
        }
        importer.getWriter().writeToNoSQL(entityList);
    }

    conn.close();
    subConnection.close();
}

From source file:de.micromata.genome.util.types.DateUtils.java

/**
 * Arbeitet ber die Millisekunden.//from  w ww  .  j av a  2 s  . com
 *
 * @param date Nie <code>null</code>.
 * @param millis Positive und negative Zahlen erlaubt. Muss im IntRange-Bereich liegen!
 * @return Das neue Datum.
 */
public static Date addTics(final Date date, final long millis) {
    if (millis < Integer.MIN_VALUE || Integer.MAX_VALUE < millis) {
        throw new IllegalArgumentException("millis out of range: " + millis);
    }
    final Calendar cal = getCalendarInstance();
    cal.setTime(date);
    cal.add(Calendar.MILLISECOND, (int) millis);
    final Date result = cal.getTime();
    return result;
}

From source file:de.robbers.dashclock.stackextension.StackExtension.java

private void clean() {
    mReputation = Integer.MIN_VALUE;
    mError = false;//ww w .  j a va 2s  .  c o m
    mVisible = true;
    mStatus = "";
    mExpandedTitle = "";
    mExpandedBody = "";
}

From source file:org.wallride.autoconfigure.WebAdminConfiguration.java

@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry.addResourceHandler("/resources/**").addResourceLocations("classpath:/resources/admin/");
    registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
    registry.setOrder(Integer.MIN_VALUE);
}