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:fr.irit.smac.amasfactory.service.execution.impl.TwoStepAgExecutionService.java

/**
 * Instantiates a new two step ag execution service.
 */
public TwoStepAgExecutionService() {
    super();
    systemStrategy = null;
    nbThreads = Integer.MIN_VALUE;
}

From source file:com.nts.alphamale.data.EventLog.java

public EventLog(String eventLog) {
    String[] evLog = StringUtils.split(eventLog, " ");
    cpuTimestamp = Double.valueOf(StringUtils.split(evLog[1], "]")[0]);
    curTimeStamp = System.currentTimeMillis();
    deviceName = evLog[2];/*from w w  w.java2 s .  c om*/
    evSynOrAbs = evLog[3];
    absLabel = evLog[4];
    try {
        absValue = !evLog[5].equals("ffffffff") ? Integer.valueOf(evLog[5], 16) : Integer.MAX_VALUE;
    } catch (NumberFormatException e) {
        if (evLog[5].equalsIgnoreCase("down")) {
            absValue = Integer.MIN_VALUE;
        }
        if (evLog[5].equalsIgnoreCase("up")) {
            absValue = Integer.MAX_VALUE;
        }
    }
}

From source file:com.scoreflex.ScoreflexGcmClient.java

protected static String getRegistrationId(Context c) {
    final SharedPreferences prefs = Scoreflex.getSharedPreferences(c);
    String registrationId = prefs.getString(GCM_REGISTRATION_ID_PREF_NAME, "");
    if (registrationId == null || registrationId.length() > 0) {
        return "";
    }/*from   w  w  w  .jav  a2s. c o  m*/

    int registeredVersion = prefs.getInt(GCM_REGISTRATION_APP_VERSION_PREF_NAME, Integer.MIN_VALUE);
    int currentVersion = getAppVersion(Scoreflex.getApplicationContext());
    if (registeredVersion != currentVersion) {
        return "";
    }
    return registrationId;
}

From source file:com.l2jfree.gameserver.instancemanager.hellbound.TowerOfNaiaManager.java

public int startInstance() {
    if (_instanceCount > 0 && !Config.ALLOW_NAIA_MULTY_PARTY_INVASION)
        return Integer.MIN_VALUE;

    _instanceCount++;/*from w ww .  ja  va 2 s .  c  o m*/
    int instanceId = InstanceManager.getInstance().createDynamicInstance("TowerOfNaiaRoom.xml");
    prepareRoom(instanceId);
    return instanceId;
}

From source file:statistic.graph.XYChart.java

private void initXAxis(String label) {
    plot.setDomainAxis(new NumberAxis(label));
    double max = Double.NEGATIVE_INFINITY;
    double min = Double.POSITIVE_INFINITY;
    for (int s = 0; s < collection.getSeriesCount(); s++) {
        for (int d = 0; d < collection.getItemCount(s); d++) {
            XYDataItem data = collection.getSeries(s).getDataItem(d);
            if (data.getX().longValue() == Integer.MAX_VALUE || data.getX().longValue() == Integer.MIN_VALUE) {
                continue;
            }/* w  ww  .  j  av a  2  s. co  m*/
            if (data.getX().doubleValue() > max) {
                max = data.getX().doubleValue();
            }
            if (data.getX().doubleValue() < min) {
                min = data.getX().doubleValue();
            }
        }
    }
    plot.getDomainAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    plot.getDomainAxis().setRange(min - 0.5, max + 0.5);
}

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

/** 
 * Metodo para guardar una instancia de 'TipoDocumento' en la tabla 
 * correspondiente de la base de datos/*from www .  j a v  a  2s  .c  om*/
 */
public void guardarTipoDocumento() {
    String msg = "Tipo de Documento Almacenado Exitosamente!";
    try {
        tipoDocumento.setIdTipoDocumento(Integer.MIN_VALUE);
        tipoDocumento
                .setIdCategoriaDoc(categoriaDocumentoService.findById(categoriaDocumento.getIdCategoriaDoc()));
        tipoDocumentoService.save(tipoDocumento);
        FacesContext.getCurrentInstance().addMessage(null,
                new FacesMessage(FacesMessage.SEVERITY_INFO, "Guardado!!", msg));

    } catch (Exception e) {
        JsfUtil.addErrorMessage("Error al Guardar Tipo de Documento!");
        e.printStackTrace();
    }
    cargarTipoDocumento();
}

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

/** 
 * Metodo para guardar una instancia de 'Ciudad' en la tabla 
 * correspondiente de la base de datos/*from  w w w . ja v a2  s  . c o m*/
 */
public void guardarCiudad() {
    String msg = "Ciudad Almacenada Exitosamente!";
    try {
        ciudad.setIdCiudad(Integer.MIN_VALUE);
        ciudad.setIdProvincia(provinciaService.findById(provincia.getIdProvincia()));
        ciudadService.save(ciudad);
        FacesContext.getCurrentInstance().addMessage(null,
                new FacesMessage(FacesMessage.SEVERITY_INFO, "Guardada!!", msg));

    } catch (Exception e) {
        JsfUtil.addErrorMessage("Error al Guardar Ciudad!");
        e.printStackTrace();
    }
    cargarCiudad();
}

From source file:ru.jts_dev.gameserver.packets.GameClientPacketHandler.java

/**
 * Find beans with {@link Opcode} annotation, and put it to {@link #packets} map
 * where key is 'first' (or single) part of packet identifier
 * and value is a bean name of packet or {@link Map} with 'second' part of
 * packet identifier as key, and packet bean name as value
 *
 * @see IncomingMessageWrapper//from  w w w .j av a2 s  .com
 */
@PostConstruct
private void postConstruct() {
    final String[] packetBeanNames = context.getBeanNamesForAnnotation(Opcode.class);

    packets = new HashMap<>(BYTES_COUNT, 1.0f);
    for (final String beanName : packetBeanNames) {
        final Opcode opcode = context.findAnnotationOnBean(beanName, Opcode.class);

        assert opcode != null : "opcode annotation not present for bean " + beanName;

        final int firstOpcode = opcode.first();
        final int secondOpcode = opcode.second();
        if (secondOpcode != Integer.MIN_VALUE) {
            final Map<Integer, Object> secondOpcodesMap = (Map<Integer, Object>) packets
                    .getOrDefault(firstOpcode, new HashMap<Integer, Object>());

            assert !secondOpcodesMap.containsKey(secondOpcode) : "duplicate second opcode for " + beanName
                    + ", old is " + secondOpcodesMap.get(secondOpcode);

            secondOpcodesMap.put(secondOpcode, beanName);
            packets.putIfAbsent(firstOpcode, secondOpcodesMap);
        }

        assert firstOpcode == CLIENT_SWITCH_OPCODE
                || !packets.containsKey(firstOpcode) : "duplicate first opcode for " + beanName + ", old is "
                        + packets.get(firstOpcode);

        packets.putIfAbsent(firstOpcode, beanName);
    }
}

From source file:io.github.karols.hocr4j.Bounds.java

/**
 * Returns the semiplane on the bottom of the horizontal line with the given coordinate.
 *
 * @param y the top edge coordinate/*from  w ww  . j  a  v a2s.  co m*/
 * @return the semiplane
 */
public static Bounds getBottomSemiplane(int y) {
    return new Bounds(Integer.MIN_VALUE, y, Integer.MAX_VALUE, Integer.MAX_VALUE);
}

From source file:io.pivotal.strepsirrhini.chaosloris.reaper.EventReaperTest.java

@Test
public void doReap() {
    Schedule schedule = new Schedule("test-schedule", "test-name");
    this.scheduleRepository.saveAndFlush(schedule);

    Application application = new Application(UUID.randomUUID());
    this.applicationRepository.saveAndFlush(application);

    Chaos chaos = new Chaos(application, 0.1, schedule);
    this.chaosRepository.saveAndFlush(chaos);

    Instant now = Instant.now();

    Event event1 = new Event(chaos, now.minus(3, DAYS), Collections.emptyList(), Integer.MIN_VALUE);
    this.eventRepository.saveAndFlush(event1);

    Event event2 = new Event(chaos, now, Collections.emptyList(), Integer.MIN_VALUE);
    this.eventRepository.saveAndFlush(event2);

    Event event3 = new Event(chaos, now.plus(3, DAYS), Collections.emptyList(), Integer.MIN_VALUE);
    this.eventRepository.saveAndFlush(event3);

    this.eventReaper.doReap().as(StepVerifier::create).expectNext(1L).expectComplete().verify();

    List<Event> events = this.eventRepository.findAll();
    assertThat(events).containsExactly(event2, event3);
}