Example usage for java.lang Long MAX_VALUE

List of usage examples for java.lang Long MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Long MAX_VALUE.

Prototype

long MAX_VALUE

To view the source code for java.lang Long MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value a long can have, 263-1.

Usage

From source file:spec.reporter.Utils.java

public static void createBmResultGraph(BenchmarkRecord record) {
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    String iterName = "";
    double max = 0;
    double min = Long.MAX_VALUE;
    for (int i = 0; i < record.iterRecords.size(); i++) {
        BenchmarkRecord.IterationRecord iterRecord = (BenchmarkRecord.IterationRecord) record.iterRecords
                .get(i);//from www .j  av  a  2  s.  c o m
        String shortName = iterRecord.iterName.replaceFirst("ation", "");
        if (iterRecord.score > max) {
            max = iterRecord.score;
            iterName = shortName;
        }

        if (iterRecord.score < min) {
            min = iterRecord.score;
        }

        dataset.addValue(iterRecord.score, " ", shortName);
    }

    JFreeChart chart = ChartFactory.createLineChart("  ", "iterations", Constants.WORKLOAD_METRIC, dataset,
            PlotOrientation.VERTICAL, false, true, false);
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(new Color(201, 222, 254));
    plot.setRangeGridlinePaint(Color.WHITE);
    if (record.isValidRun() && min != Long.MAX_VALUE) {
        plot.getRangeAxis().setRange(min - 10, max + 10);
    } else {
        plot.getRangeAxis().setRange(0, max + 10);
    }
    ValueMarker vm = new ValueMarker(record.maxScore);
    vm.setLabel(Utils.df.format(record.maxScore));
    vm.setLabelAnchor(RectangleAnchor.TOP_LEFT);
    vm.setLabelTextAnchor(TextAnchor.HALF_ASCENT_LEFT);

    plot.addRangeMarker(vm);
    CategoryMarker marker = new CategoryMarker(iterName);
    marker.setDrawAsLine(true);
    marker.setPaint(vm.getPaint());
    plot.addDomainMarker(marker);
    LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
    renderer.setShapesVisible(true);
    renderer.setDrawOutlines(true);
    renderer.setUseFillPaint(true);
    renderer.setFillPaint(Color.WHITE);
    renderer.setSeriesPaint(0, Color.BLUE.darker());

    try {
        ChartUtilities.saveChartAsJPEG(new File(Utils.getFullImageName(record.name + "_results")), chart, 300,
                200);
    } catch (Exception e) {
        System.out.println("Problems...");
    }
}

From source file:gaffer.serialisation.implementation.raw.CompactRawLongSerialiserTest.java

@Test
public void canSerialiseLongMaxValue() throws SerialisationException {
    test(Long.MAX_VALUE);
}

From source file:com.thinkbiganalytics.spark.validation.HCatDataTypeTest.java

@Test
public void testIsValueConvertibleToIntType() throws Exception {

    HCatDataType intType = HCatDataType.getDataTypes().get("int");

    assertTrue(intType.isValueConvertibleToType("0"));
    assertTrue(intType.isValueConvertibleToType(Integer.MAX_VALUE + ""));
    assertTrue(intType.isValueConvertibleToType(Integer.MIN_VALUE + ""));

    assertTrue(intType.isValueConvertibleToType(null));
    assertTrue(intType.isValueConvertibleToType(""));

    assertFalse(intType.isValueConvertibleToType("21.1"));
    assertFalse(intType.isValueConvertibleToType("-20.001"));
    assertFalse(intType.isValueConvertibleToType(Long.MAX_VALUE + ""));

}

From source file:com.weib.spittr.web.SpittleControllerTest.java

@Test
public void getSpittleTest() throws Exception {
    //??//w  w  w  . jav a2 s .c  o  m
    List<Spittle> spittleList = createSpittleList(20); //?20??
    SpittleRepository mockRepository = mock(SpittleRepository.class); //??Mock
    when(mockRepository.findSpittles(Long.MAX_VALUE, 20)) //??
            .thenReturn(spittleList);

    //controller
    SpittleController controller = new SpittleController(mockRepository); //controller
    MockMvc mockMvc = standaloneSetup(controller)
            .setSingleView(new InternalResourceView("/WEB-INF/views/spittles.jsp") //????setSingleView
            ).build();

    //?GET/spittles
    mockMvc.perform(get("/spittles")).andExpect(view().name("spittles"))
            .andExpect(model().attributeExists("spittleList11"))
            .andExpect(model().attribute("spittleList11", hasItems(spittleList.toArray())));

}

From source file:com.basetechnology.s0.agentserver.field.IntField.java

public IntField(SymbolTable symbolTable, String name) {
    this.symbol = new Symbol(symbolTable, name, IntegerTypeNode.one);
    this.label = name;
    minValue = Long.MIN_VALUE;/*from w w  w.  ja va 2s  .c om*/
    maxValue = Long.MAX_VALUE;
}

From source file:ByteRange.java

public ByteRange(String string) throws NumberFormatException {
    string = string.trim();/*from   w  w  w .  ja va  2s.  c  o  m*/
    int dashPos = string.indexOf('-');
    int length = string.length();
    if (string.indexOf(',') != -1) {
        throw new NumberFormatException("Simple ByteRange String contains a comma.");
    }
    if (dashPos > 0) {
        this.start = Integer.parseInt(string.substring(0, dashPos));
    } else {
        this.start = Long.MIN_VALUE;
    }
    if (dashPos < length - 1) {
        this.end = Integer.parseInt(string.substring(dashPos + 1, length));
    } else {
        this.end = Long.MAX_VALUE;
    }
    if (this.start > this.end) {
        throw new NumberFormatException("Start value is greater than end value.");
    }
}

From source file:com.jivesoftware.os.server.http.jetty.jersey.server.provider.DefaultJerseyMapperTest.java

@DataProvider
public Object[][] values() {
    return new Object[][] {
            { new Types(true, (byte) 1, (short) 2, (char) 3, 4, Long.MAX_VALUE - 5L, 6.0f, 7.0, "abc") },
            { new Types(false, (byte) 8, (short) 9, (char) 10, 11, Long.MAX_VALUE - 12L, 13.0f, 14.0,
                    "def") }, };
}

From source file:com.lithium.flow.io.InputStreamSpliterator.java

@Override
public long estimateSize() {
    return Long.MAX_VALUE;
}

From source file:com.caseystella.analytics.outlier.streaming.mad.ConfusionMatrix.java

public static long closest(long ts, Set<Long> set) {
    long dist = Long.MAX_VALUE;
    long ret = Long.MAX_VALUE;
    for (Long s : set) {
        long d = Math.abs(ts - s);
        if (d < dist) {
            dist = d;/*  ww w  . ja va  2  s  .c o m*/
            ret = s;
        }
    }
    return ret;
}

From source file:cz.sohlich.workstack.security.MongoUserDetailService.java

@PostConstruct
public void postConstruct() {

    if (repository.findByUsername("admin") == null) {
        cz.sohlich.workstack.domain.User user = new cz.sohlich.workstack.domain.User();
        user.setUsername("admin");
        user.setFirstname("admin");
        user.setLastname("admin");
        user.setAccountNonExpired(true);
        user.setAccountNonLocked(true);/*from   ww  w .ja v a2  s . c  o  m*/
        user.setCredentialsNonExpired(true);
        user.setEnabled(true);
        user.setPassword(encoder.encode("admin"));
        user.setAuthorities(Arrays.asList(new UserAuthority("USER"), new UserAuthority("ADMIN")));
        user.setExpires(Long.MAX_VALUE);
        repository.save(user);
    }
    ;

}