Example usage for java.lang Long MIN_VALUE

List of usage examples for java.lang Long MIN_VALUE

Introduction

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

Prototype

long MIN_VALUE

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

Click Source Link

Document

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

Usage

From source file:br.com.blackhubos.eventozero.updater.assets.uploader.Uploader.java

public Uploader() {
    this(null, false, Long.MIN_VALUE);
}

From source file:com.netflix.config.DynamicFileConfigurationTest.java

static void modifyConfigFile() {
    new Thread() {
        public void run() {
            try {
                BufferedWriter writer = new BufferedWriter(
                        new OutputStreamWriter(new FileOutputStream(configFile), "UTF-8"));
                writer.write("abc=-2"); // this property should fail validation but should not affect update of other properties
                writer.newLine();/*from   w  w  w.  ja  v a 2  s .  co  m*/
                writer.write("dprops1=" + String.valueOf(Long.MIN_VALUE));
                writer.newLine();
                writer.write("dprops2=" + String.valueOf(Double.MAX_VALUE));
                writer.newLine();
                writer.close();
                System.err.println(configFile.getPath() + " modified");
            } catch (Exception e) {
                e.printStackTrace();
                fail("Unexpected exception");
            }
        }
    }.start();
}

From source file:com.bmwcarit.barefoot.markov.Sample.java

/**
 * Creates {@link Sample} object from JSON representation.
 *
 * @param json JSON representation of a sample.
 * @throws JSONException thrown on JSON extraction or parsing error.
 *///from  w  w  w .j a v  a2  s .c  om
public Sample(JSONObject json) throws JSONException {
    time = json.optLong("time", Long.MIN_VALUE);
    if (time == Long.MIN_VALUE) {
        String string = json.optString("time", "");
        if (!string.isEmpty()) {
            try {
                time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssX").parse(json.getString("time")).getTime();
            } catch (ParseException e) {
                throw new JSONException(e);
            }
        } else {
            throw new JSONException("time key not found");
        }
    }
}

From source file:lirmm.inria.fr.math.OpenLongToDoubleHashMapTest.java

@Before
public void setUp() throws Exception {
    javaMap.put(Long.valueOf(50), 100.0);
    javaMap.put(Long.valueOf(75), 75.0);
    javaMap.put(Long.valueOf(25), 500.0);
    javaMap.put(Long.MAX_VALUE, Double.MAX_VALUE);
    javaMap.put(Long.valueOf(0), -1.0);
    javaMap.put(Long.valueOf(1), 0.0);
    javaMap.put(Long.valueOf(33), -0.1);
    javaMap.put(Long.valueOf(23234234), -242343.0);
    javaMap.put(Long.valueOf(23321), Double.MIN_VALUE);
    javaMap.put(Long.valueOf(-4444), 332.0);
    javaMap.put(Long.valueOf(-1), -2323.0);
    javaMap.put(Long.MIN_VALUE, 44.0);
    javaMap.put(Long.valueOf("7263934625316938832"), 224.0);

    /* Add a few more to cause the table to rehash */
    javaMap.putAll(generate());/*  ww w .java  2 s .c om*/

}

From source file:ByteRange.java

public ByteRange(String string) throws NumberFormatException {
    string = string.trim();//from  w  w w.  j a  v  a2 s .  co  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:gaffer.serialisation.implementation.raw.CompactRawLongSerialiserTest.java

@Test
public void canSerialiseLongMinValue() throws SerialisationException {
    test(Long.MIN_VALUE);
}

From source file:id.ac.idu.backend.model.SecLoginlog.java

@Override
public boolean isNew() {
    return (getId() == Long.MIN_VALUE);
}

From source file:de.forsthaus.backend.model.SecLoginlog.java

@Override
public boolean isNew() {
    return (getId() == Long.MIN_VALUE + 1);
}

From source file:com.dataartisans.timeoutmonitoring.TimestampExtractorFunction.java

@Override
public Long apply(JSONObject jsonObject) {
    String timestamp = jsonObject.optString(timestampField);

    if (timestamp == null) {
        return Long.MIN_VALUE;
    } else {//from  www .ja v a2s.  co  m
        DateTime dateTime = formatter.parseDateTime(timestamp);
        return dateTime.getMillis();
    }
}

From source file:org.cloudfoundry.metron.MetronMetricWriterTest.java

@Test
public void increment() {
    this.metricWriter.onOpen(this.session, null);
    this.metricWriter.increment(new Delta<>("test-name", Long.MIN_VALUE));

    verify(this.async, new CounterEvent.Builder().name("test-name").delta(Long.MIN_VALUE).build());
}