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.joconner.g11n.charprop.service.BlocksServiceTest.java

@Test
public void testNoBlockForUndefinedChars() {
    Block noBlock = service.getNoBlock();

    int[] ch = { Integer.MIN_VALUE, -1, 0x10fff, 0x104B0, 0x2CEB0, 0x110000, Integer.MAX_VALUE };

    for (int c : ch) {
        Block b = service.getBlockFor(c);
        assertEquals(noBlock, b);//from   ww  w.java 2 s  .c o  m
    }

}

From source file:com.mkl.websuites.command.BaseCommand.java

@Override
public void run() {

    if (webElementWaitTimeout == Integer.MIN_VALUE) {
        setWebElementWaitTimeout(WebSuitesConfig.get().site().waitTimeout());
    }//from  w  ww.  j a  v  a2 s . c o  m

    browser = ServiceFactory.get(BrowserController.class).getWebDriver();

    log.debug("running " + this.getClass().getName() + " command");

    try {
        runStandardCommand();

    } catch (Throwable e) {

        augmentErrorMessageWithCommandSourceFileInfo(e);
        throw e;
    }

}

From source file:com.jernejerin.traffic.helper.TripOperations.java

/**
 * Parses and validates a trip for erroneous values. It first checks, if parsed string contains
 * 17 values. If it does not, it returns null.
 *
 * If the value is considered erroneous, it is set to the following values:
 *  - primitive types: MIN_VALUE//from   w  w w .j a  v a 2 s . co m
 *  - objects: null
 *
 * @param tripValues comma delimited string representing Trip to check
 * @param timestampReceived Timestamp when the event was received
 * @param id id of the event received
 * @return a Trip with erroneous values set to MIN_VALUE, or null if whole trip was malformed
 */
public static Trip parseValidateTrip(String tripValues, long timestampReceived, int id) {
    //        LOGGER.log(Level.INFO, "Started parsing and validating trip = " +
    //                tripValues + " from thread = " + Thread.currentThread());

    // our returned trip
    Trip trip = new Trip();

    // values are comma separated
    String[] tripSplit = tripValues.split(",");

    // if we do not have 17 values, then return null
    if (tripSplit.length != 17)
        return null;

    // check for correct values and then set them
    trip.setId(id);
    trip.setMedallion(tryParseMD5(tripSplit[0], null));
    trip.setHackLicense(tryParseMD5(tripSplit[1], null));
    trip.setPickupDatetime(tryParseDateTime(tripSplit[2], null));
    trip.setDropOffDatetime(tryParseDateTime(tripSplit[3], null));
    trip.setDropOffTimestamp(
            trip.getDropOffDatetime() != null ? trip.getDropOffDatetime().toEpochSecond(ZoneOffset.UTC) * 1000
                    : 0);
    trip.setTripTime(NumberUtils.toInt(tripSplit[4], Integer.MIN_VALUE));
    trip.setTripDistance(NumberUtils.toFloat(tripSplit[5], Integer.MIN_VALUE));
    trip.setPickupLongitude(tryLongitude(tripSplit[6], Float.MIN_VALUE));
    trip.setPickupLatitude(tryLatitude(tripSplit[7], Float.MIN_VALUE));
    trip.setDropOffLongitude(tryLongitude(tripSplit[8], Float.MIN_VALUE));
    trip.setDropOffLatitude(tryLatitude(tripSplit[9], Float.MIN_VALUE));
    trip.setPaymentType(tryPayment(tripSplit[10], null));
    trip.setFareAmount(NumberUtils.toFloat(tripSplit[11], Float.MIN_VALUE));
    trip.setSurcharge(NumberUtils.toFloat(tripSplit[12], Float.MIN_VALUE));
    trip.setMtaTax(NumberUtils.toFloat(tripSplit[13], Float.MIN_VALUE));
    trip.setTipAmount(NumberUtils.toFloat(tripSplit[14], Float.MIN_VALUE));
    trip.setTollsAmount(NumberUtils.toFloat(tripSplit[15], Float.MIN_VALUE));
    trip.setTotalAmount(NumberUtils.toFloat(tripSplit[16], Float.MIN_VALUE));
    trip.setTimestampReceived(timestampReceived);

    // does the coordinate for pickup location lie inside grid
    if (Cell.inGrid(trip.getPickupLatitude(), trip.getPickupLongitude())
            && Cell.inGrid(trip.getDropOffLatitude(), trip.getDropOffLongitude())) {
        trip.setRoute250(new Route(new Cell250(trip.getPickupLatitude(), trip.getPickupLongitude()),
                new Cell250(trip.getDropOffLatitude(), trip.getDropOffLongitude())));
        trip.setRoute500(new Route(new Cell500(trip.getPickupLatitude(), trip.getPickupLongitude()),
                new Cell500(trip.getDropOffLatitude(), trip.getDropOffLongitude())));
    }

    //        LOGGER.log(Level.INFO, "Finished parsing and validating trip = " +
    //                trip.toString() + " from thread = " + Thread.currentThread());
    return trip;
}

From source file:com.p5solutions.core.utils.NumberUtils.java

public static boolean isInteger(String value) {
    if (isNatural(value)) {
        Long v = NumberUtils.valueOf(value.toString(), Long.class);
        if (v >= Integer.MIN_VALUE && v <= Integer.MAX_VALUE) {
            return true;
        }/*  w ww .  ja  v a  2  s  . co  m*/
    }
    return false;
}

From source file:net.aksingh.owmjapis.AbstractResponse.java

AbstractResponse() {
    this.rawResponse = null;
    this.responseCode = Integer.MIN_VALUE;
}

From source file:com.kibana.multitenancy.plugin.acl.SearchGuardACLRequestActionFilter.java

public int order() {
    return Integer.MIN_VALUE;
}

From source file:org.eclipse.swt.examples.browser.demos.Pawns.java

public void playRequest(byte[][] game, int type) {
    threadStop = true;//  w ww  .  j  av  a  2 s  .c  om
    synchronized (this) {
        bestIndex = -1;
        bestScore = Integer.MIN_VALUE;
        convert(game, this.game);
        initPawnBorders(this.game, gameWallWeight);
        /* Quickly compute a legal move */
        for (int i = 0; i < this.game.length; i++) {
            if (this.game[i] == EMPTY) {
                bestIndex = i;
                break;
            }
        }
        new Thread() {
            @Override
            public void run() {
                synchronized (Pawns.this) {
                    threadStop = false;
                    int[] result = new int[2];
                    /* if long time, must check for threadStop and exit early */
                    evalBest(Pawns.this.game, BLACK, 2, result);
                    bestIndex = result[0];
                    bestScore = result[1];
                }
            }
        }.start();
    }
}

From source file:userinterface.AdministratorWorkArea.PopularDoctorJPanel.java

public void populateTable() {

    int max1 = Integer.MIN_VALUE;
    int max2 = Integer.MIN_VALUE;
    int max3 = Integer.MIN_VALUE;

    for (Organization organization : enterprise.getOrganizationDirectory().getOrganizationList()) {
        if (organization instanceof DoctorOrganization) {
            docOrg = organization;//from   w  ww. ja  va  2 s  .  c  o  m
            break;
        }
    }
    if (docOrg != null) {

        for (Employee doctor : docOrg.getEmployeeDirectory().getEmployeeList()) {
            if (doctor.getPatientCount() > max1) {
                max3 = max2;
                max2 = max1;
                max1 = doctor.getPatientCount();

                doc3 = doc2;
                doc2 = doc1;
                doc1 = doctor;
            } else if (doctor.getPatientCount() > max2 && doctor.getPatientCount() <= max1) {
                max3 = max2;
                max2 = doctor.getPatientCount();
                doc3 = doc2;
                doc2 = doctor;
            } else if (doctor.getPatientCount() <= max2 && doctor.getPatientCount() > max3) {
                max3 = doctor.getPatientCount();
                doc3 = doctor;
            }

        }

        if (doc3 != null && doc2 != null && doc1 != null) {
            topDocList.add(doc1);
            topDocList.add(doc2);
            topDocList.add(doc3);
        } else if (doc2 != null && doc1 != null) {
            topDocList.add(doc1);
            topDocList.add(doc2);
        } else if (doc1 != null) {
            topDocList.add(doc1);
        }

        //         topDocList.add(doc1);
        //         topDocList.add(doc2);
        //         topDocList.add(doc3);
    }

    DefaultTableModel dtm = (DefaultTableModel) doctorTable.getModel();

    int rowcount = doctorTable.getRowCount();

    for (int i = rowcount - 1; i >= 0; i--) {
        dtm.removeRow(i);
    }

    if (topDocList != null) {
        for (Employee doctor : topDocList) {

            Object row[] = new Object[2];
            row[0] = doctor == null ? "No Doctors in the Organization" : doctor;

            row[1] = doctor == null ? " " : doctor.getPatientCount();
            dtm.addRow(row);
        }

    } else {
        return;
    }

}

From source file:statistic.graph.JChartPanel.java

public void add(String key, double value) {
    XYSeries series = new XYSeries(key);
    stepDataset.addSeries(series);// w w w  .j  av a 2  s .  c o m
    series.add(Integer.MIN_VALUE, 0);
    series.add(0, value);
    series.add(Integer.MAX_VALUE, value);
}

From source file:org.eclipse.swt.examples.paint.SolidPolygonFigure.java

@Override
public void addDamagedRegion(FigureDrawContext fdc, Region region) {
    int xmin = Integer.MAX_VALUE, ymin = Integer.MAX_VALUE;
    int xmax = Integer.MIN_VALUE, ymax = Integer.MIN_VALUE;

    for (int i = 0; i < points.length; i += 2) {
        if (points[i] < xmin)
            xmin = points[i];//w w  w .j a  v  a 2s  .  c  o  m
        if (points[i] > xmax)
            xmax = points[i];
        if (points[i + 1] < ymin)
            ymin = points[i + 1];
        if (points[i + 1] > ymax)
            ymax = points[i + 1];
    }
    region.add(fdc.toClientRectangle(xmin, ymin, xmax, ymax));
}