List of usage examples for java.lang Integer MIN_VALUE
int MIN_VALUE
To view the source code for java.lang Integer MIN_VALUE.
Click Source Link
From source file:com.od.jtimeseries.ui.visualizer.chart.creator.EfficientXYLineAndShapeRenderer.java
public XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info) {//from w w w. j a v a 2 s . c om minY = Integer.MAX_VALUE; maxY = Integer.MIN_VALUE; storedLine = false; linesDrawn = 0; return super.initialise(g2, dataArea, plot, data, info); }
From source file:marshalsec.gadgets.ToStringUtil.java
public static String unhash(int hash) { int target = hash; StringBuilder answer = new StringBuilder(); if (target < 0) { // String with hash of Integer.MIN_VALUE, 0x80000000 answer.append("\\u0915\\u0009\\u001e\\u000c\\u0002"); if (target == Integer.MIN_VALUE) return answer.toString(); // Find target without sign bit set target = target & Integer.MAX_VALUE; }/* w ww. j a va2 s. c om*/ unhash0(answer, target); return answer.toString(); }
From source file:com.nts.alphamale.data.EventLog.java
public EventLog(Matcher m) { cpuTimestamp = Double.valueOf(m.group(1)); curTimeStamp = System.currentTimeMillis(); deviceName = m.group(2);/* w w w . j a v a 2 s . c o m*/ evSynOrAbs = m.group(3); absLabel = m.group(4); try { absValue = !m.group(5).equals("ffffffff") ? Integer.valueOf(m.group(5), 16) : Integer.MAX_VALUE; } catch (NumberFormatException e) { if (m.group(5).equalsIgnoreCase("down")) { absValue = Integer.MIN_VALUE; } if (m.group(5).equalsIgnoreCase("up")) { absValue = Integer.MAX_VALUE; } } }
From source file:org.elasticsearch.client.sniff.SnifferBuilderTests.java
public void testBuild() throws Exception { int numNodes = RandomNumbers.randomIntBetween(getRandom(), 1, 5); HttpHost[] hosts = new HttpHost[numNodes]; for (int i = 0; i < numNodes; i++) { hosts[i] = new HttpHost("localhost", 9200 + i); }/*from w w w . j a va2 s . c o m*/ try (RestClient client = RestClient.builder(hosts).build()) { try { Sniffer.builder(null).build(); fail("should have failed"); } catch (NullPointerException e) { assertEquals("restClient cannot be null", e.getMessage()); } try { Sniffer.builder(client) .setSniffIntervalMillis(RandomNumbers.randomIntBetween(getRandom(), Integer.MIN_VALUE, 0)); fail("should have failed"); } catch (IllegalArgumentException e) { assertEquals("sniffIntervalMillis must be greater than 0", e.getMessage()); } try { Sniffer.builder(client).setSniffAfterFailureDelayMillis( RandomNumbers.randomIntBetween(getRandom(), Integer.MIN_VALUE, 0)); fail("should have failed"); } catch (IllegalArgumentException e) { assertEquals("sniffAfterFailureDelayMillis must be greater than 0", e.getMessage()); } try { Sniffer.builder(client).setHostsSniffer(null); fail("should have failed"); } catch (NullPointerException e) { assertEquals("hostsSniffer cannot be null", e.getMessage()); } try (Sniffer sniffer = Sniffer.builder(client).build()) { assertNotNull(sniffer); } SnifferBuilder builder = Sniffer.builder(client); if (getRandom().nextBoolean()) { builder.setSniffIntervalMillis(RandomNumbers.randomIntBetween(getRandom(), 1, Integer.MAX_VALUE)); } if (getRandom().nextBoolean()) { builder.setSniffAfterFailureDelayMillis( RandomNumbers.randomIntBetween(getRandom(), 1, Integer.MAX_VALUE)); } if (getRandom().nextBoolean()) { builder.setHostsSniffer(new MockHostsSniffer()); } try (Sniffer sniffer = builder.build()) { assertNotNull(sniffer); } } }
From source file:net.aksingh.owmjapis.AbstractResponse.java
AbstractResponse(JSONObject jsonObj) { this.rawResponse = (jsonObj != null) ? jsonObj.toString() : null; this.responseCode = (jsonObj != null) ? jsonObj.optInt(JSON_RESPONSE_CODE, Integer.MIN_VALUE) : Integer.MIN_VALUE;/*from ww w . j ava 2 s.com*/ }
From source file:com.effektif.workflow.api.types.NumberType.java
/** * Parse a text value as a Integer, Long or Double, as appropriate. * Based on com.fasterxml.jackson.databind.deser.std.NumberDeserializers.NumberDeserializer#deserialize(JsonParser, DeserializationContext) *///from w w w .java2 s.c om private Number parseValue(String value) { if (value == null) { return null; } value = value.trim(); try { boolean decimal = value.contains("."); if (decimal) { return Double.valueOf(value); } else { long longValue = Long.parseLong(value); if (longValue <= Integer.MAX_VALUE && longValue >= Integer.MIN_VALUE) { return (int) longValue; } return longValue; } } catch (NumberFormatException e) { return null; } }
From source file:io.yields.math.framework.range.IntegerRange.java
private static Integer getIntValue(String value) { if (ComparableRange.NEG_INFTY.equals(value)) { return Integer.MIN_VALUE; }//w w w . ja va 2 s . c om if (ComparableRange.POS_INFTY.equals(value)) { return Integer.MAX_VALUE; } return new Integer(value); }
From source file:com.mapr.synth.samplers.IntegerSampler.java
@Override public JsonNode sample() { synchronized (this) { int r = power >= 0 ? Integer.MAX_VALUE : Integer.MIN_VALUE; if (power >= 0) { for (int i = 0; i <= power; i++) { r = Math.min(r, min + base.nextInt(max - min)); }/*from w w w.j a v a 2 s. co m*/ } else { int n = -power; for (int i = 0; i <= n; i++) { r = Math.max(r, min + base.nextInt(max - min)); } } return new IntNode(r); } }
From source file:io.pivotal.strepsirrhini.chaosloris.web.EventResourceAssemblerTest.java
@Test public void toResource() { Application application = new Application(UUID.randomUUID()); application.setId(-1L);/*w w w . ja v a2 s .c o m*/ Schedule schedule = new Schedule("0 0 * * * *", "hourly"); schedule.setId(-2L); Chaos chaos = new Chaos(application, 0.2, schedule); chaos.setId(-3L); Event event = new Event(chaos, Instant.EPOCH, Collections.emptyList(), Integer.MIN_VALUE); event.setId(-4L); EventResourceAssembler.EventResource resource = this.resourceAssembler.toResource(event); assertThat(resource.getContent()).isSameAs(event); assertThat(resource.getLinks()).hasSize(2); assertThat(resource.getLink("chaos")).isNotNull(); }
From source file:com.ewcms.content.resource.web.ResourceAction.java
private boolean isNewAdd() { return id == Integer.MIN_VALUE; }