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:net.sf.jasperreports.crosstabs.fill.calculation.ArbitraryRankComparator.java

protected synchronized long rank(Object o) {
    long rank;/*from w w  w  .j a  va 2  s  . com*/
    Long existingRank = ranks.get(o);
    if (existingRank == null) {
        rank = rankCounter;

        ++rankCounter;
        // check for overflow, very unlikely
        if (rankCounter == Long.MIN_VALUE) {
            throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_RANK_COMPARATOR_OVERFLOW, (Object[]) null);
        }

        ranks.put(o, rank);
    } else {
        rank = existingRank;
    }
    return rank;
}

From source file:nl.gridline.zieook.statistics.popularity.PopularityMap.java

@Override
protected void setup(Context context) throws IOException, InterruptedException {

    String types = context.getConfiguration().get(PopularityStatistics.TYPES);
    if (types == null) {
        throw new IOException(
                "failed to read <" + PopularityStatistics.TYPES + "> please set the configuration item");
    }/*from w w w.  j a v a2 s.co  m*/

    now = context.getConfiguration().getLong(PopularityStatistics.NOW, Long.MIN_VALUE);
    if (now == Long.MIN_VALUE) {
        throw new IOException(
                "failed to read <" + PopularityStatistics.NOW + "> please set the configuration item");
    }

    typeMap = PopularityStatistics.getTypes(types);

    this.types = typeMap.keySet();
    LOG.info("setting now to: " + now);
    LOG.info("types: '" + types + "' split into " + this.types.size() + " items");
    for (Map.Entry<Long, String> entry : typeMap.entrySet()) {
        LOG.info(entry.getValue() + " <" + (now - entry.getKey()) + "," + now + ">");
    }

}

From source file:de.upb.timok.ProgressEstimator.java

public static long average(final List<Long> jobDurations2) {
    long sum = 0;
    int size = 0;
    synchronized (jobDurations2) {
        size = jobDurations2.size();//from   w  ww . ja  v a2s  .  c  o  m
        final Iterator<Long> i = jobDurations2.iterator();
        while (i.hasNext()) {
            sum += i.next();
        }
    }
    if (size == 0) {
        return Long.MIN_VALUE;
    }
    return sum / size;
}

From source file:com.github.lynxdb.server.core.TimeSerie.java

public static TimeSerie merge(List<TimeSerie> _series) {
    Assert.notEmpty(_series);//  ww w  .j  a  v a  2s.c  om

    List<SuperIterator> sil = new ArrayList<>();

    _series.forEach((TimeSerie t) -> {
        if (t.hasNext()) {
            SuperIterator<Entry> si = new SuperIterator<>(t);
            si.next();
            sil.add(si);
        }
    });

    Map<String, String> tags = new HashMap<>();
    tags.putAll(_series.get(0).getTags());

    _series.forEach((TimeSerie t) -> {
        Iterator<Map.Entry<String, String>> i = tags.entrySet().iterator();
        while (i.hasNext()) {
            Map.Entry<String, String> e = i.next();
            if (!t.getTags().containsKey(e.getKey()) || !t.getTags().get(e.getKey()).equals(e.getValue())) {
                i.remove();
            }

        }
    });

    return new TimeSerie(_series.get(0).getName(), tags, new ChainableIterator<Entry>() {

        @Override
        public boolean hasNext() {
            return sil.stream()
                    .anyMatch((superIterator) -> superIterator.hasNext() || superIterator.getCurrent() != null);
        }

        @Override
        public Entry next() {

            Iterator<SuperIterator> rr = sil.iterator();
            while (rr.hasNext()) {
                if (rr.next().getCurrent() == null) {
                    rr.remove();
                }
            }

            long max = Long.MIN_VALUE;
            for (SuperIterator<Entry> r : sil) {
                max = Long.max(max, r.getCurrent().getTime());
            }
            for (SuperIterator<Entry> r : sil) {
                if (r.getCurrent().getTime() == max) {
                    r.next();
                    return r.getPrevious();
                }
            }

            throw new IllegalStateException("something went wrong");
        }
    });
}

From source file:com.tilab.fiware.metaware.service.DatasetServiceTest.java

@BeforeClass
public static void setUpClass() {
    testProperties = new Properties();
    testProperties.setProperty("db.host", "localhost");
    testProperties.setProperty("db.port", "27017");
    testProperties.setProperty("db.name", "MetadataRepoTest"); // DB test
    INSTANCE.setManualProperties(testProperties);

    INSTANCE.createCoreObjects();//from  w  w  w.ja v  a 2 s. c  om

    // Objects definition
    comp = new Company("company test name", "company test description", "company@test.com", "123456",
            "Via Reiss Romoli, 274 Torino", "company.test.one.com");
    dep = new Department("department test name", "department test description", null, // company id is set after
            "dep@test.com", "123456", "Via Reiss Romoli, 274 Torino", "http://dep.test.com");
    user1 = new User("user test name 1", "user test surname 1", "user1@test.com", "123456",
            "Via Reiss Romoli, 274 Torino", null, null, "usernametestalgo1", "secret", ""); // company id and department id are set after
    user2 = new User("user test name 2", "user test surname 2", "user2@test.com", "654321",
            "Via Reiss Romoli, 274 Torino", null, null, "usernametestalgo2", "secret", ""); // company id and department id are set after
    perm1 = new Permission(null, "rud"); // user id is set after
    perm2 = new Permission(null, "r"); // user id is set after
    data1 = new Dataset("dataset test name 1", "dataset test description 1", "test", Long.MIN_VALUE,
            Long.MIN_VALUE, null, null, "private", true, new DatasetStructure());
    data2 = new Dataset("dataset test name 2", "dataset test description 2", "test", Long.MIN_VALUE,
            Long.MIN_VALUE, null, null, "private", true, new DatasetStructure());
}

From source file:com.fusesource.forge.jmstest.executor.AbstractBenchmarkClient.java

protected ProbeRunner getProbeRunner() {
    long duration = Long.MIN_VALUE;
    for (BenchmarkPartConfig partConfig : getConfig().getBenchmarkParts()) {
        try {/*from   w w w .ja v a  2  s  . c o  m*/
            BenchmarkIteration iteration = getIteration(partConfig.getProfileName());
            long partDuration = iteration.getTotalDuration();
            if (partDuration > duration) {
                duration = partDuration;
            }
        } catch (Exception e) {
            // ignore
        }
    }
    if (probeRunner == null) {
        probeRunner = new ProbeRunner();
        probeRunner.setName(getClientId().toString());
        probeRunner.setInterval(1);
        probeRunner.setDuration(duration);
    }
    return probeRunner;
}

From source file:com.tilab.fiware.metaware.service.DataSourceServiceTest.java

@BeforeClass
public static void setUpClass() {
    testProperties = new Properties();
    testProperties.setProperty("db.host", "localhost");
    testProperties.setProperty("db.port", "27017");
    testProperties.setProperty("db.name", "MetadataRepoTest"); // DB test
    INSTANCE.setManualProperties(testProperties);

    INSTANCE.createCoreObjects();/* w  w w  .  j ava 2 s .c  o m*/

    // Objects definition
    comp = new Company("company test name", "company test description", "company@test.com", "123456",
            "Via Reiss Romoli, 274 Torino", "company.test.one.com");
    dep = new Department("department test name", "department test description", null, // company id is set after
            "dep@test.com", "123456", "Via Reiss Romoli, 274 Torino", "http://dep.test.com");
    user1 = new User("user test name 1", "user test surname 1", "user1@test.com", "123456",
            "Via Reiss Romoli, 274 Torino", null, null, "usernametestalgo1", "secret", ""); // company id and department id are set after
    user2 = new User("user test name 2", "user test surname 2", "user2@test.com", "654321",
            "Via Reiss Romoli, 274 Torino", null, null, "usernametestalgo2", "secret", ""); // company id and department id are set after
    perm1 = new Permission(null, "rud"); // user id is set after
    perm2 = new Permission(null, "r"); // user id is set after
    datas1 = new DataSource("datasource test 1", "this is just a test 1", "test type", Long.MIN_VALUE,
            Long.MIN_VALUE, null, null, "test status", "test subtype", "jdbc:mysql://localhost/test/one",
            "testUsernameOne", "superSecretOne", "query", "SELECT * FROM TEST");
    datas2 = new DataSource("datasource test 2", "this is just a test 2", "test type", Long.MIN_VALUE,
            Long.MIN_VALUE, null, null, "test status", "test subtype", "jdbc:mysql://localhost/test/two",
            "testUsernameTwo", "superSecretTwo", "query", "SELECT * FROM TEST");
}

From source file:com.fullmeadalchemist.mustwatch.ui.recipe.detail.RecipeDetailFragment.java

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    initClickListeners();//from  w w w . j a v a2  s . co m

    Bundle bundle = this.getArguments();
    if (bundle != null) {
        long recipeId = bundle.getLong(RECIPE_ID, Long.MIN_VALUE);
        Timber.v("Got Recipe ID %d from the NavigationController.", recipeId);

        if (recipeId != Long.MIN_VALUE) {
            if (viewModel.recipe != null) {
                Timber.v("Reusing viewmodel data");
                dataBinding.setRecipe(viewModel.recipe);
                updateRecipeUiInfo();
                updateRecipeIngredientUiInfo();
            } else {
                Timber.v("Going to the RecipeRepository to get the Recipe with id %s", recipeId);
                viewModel.getRecipe(recipeId).observe(this, recipe -> {
                    if (recipe != null) {
                        Timber.v("Loaded Recipe with ID %d:\n%s", recipe.id, recipe);

                        viewModel.recipe = recipe;
                        dataBinding.setRecipe(viewModel.recipe);
                        updateRecipeUiInfo();

                        viewModel.getRecipeIngredients(recipeId).observe(this, recipeIngredients -> {
                            if (recipeIngredients != null) {
                                Timber.v("Loaded %s Recipe ingredients", recipeIngredients.size());
                                viewModel.recipe.ingredients = recipeIngredients;
                                updateRecipeIngredientUiInfo();
                            } else {
                                Timber.w(
                                        "Received nothing from the RecipeRepository when trying to get ingredients for Recipe %s",
                                        recipeId);
                            }
                        });

                    } else {
                        Timber.w("Received a null Batch from the RecipeDetailViewModel.");
                    }
                });
            }
        }
    } else {
        Timber.i("No Recipe ID was received. Redirecting to the Batch Creation form.");
        navigationController.navigateToAddBatch();
    }
}

From source file:com.tilab.fiware.metaware.service.AlgorithmServiceTest.java

@BeforeClass
public static void setUpClass() {
    testProperties = new Properties();
    testProperties.setProperty("db.host", "localhost");
    testProperties.setProperty("db.port", "27017");
    testProperties.setProperty("db.name", "MetadataRepoTest"); // DB test
    INSTANCE.setManualProperties(testProperties);

    INSTANCE.createCoreObjects();//from ww w  . j  a  v  a2  s. c om

    // Objects definition
    comp = new Company("company test name", "company test description", "company@test.com", "123456",
            "Via Reiss Romoli, 274 Torino", "company.test.one.com");
    dep = new Department("department test name", "department test description", null, // company id is set after
            "dep@test.com", "123456", "Via Reiss Romoli, 274 Torino", "http://dep.test.com");
    user1 = new User("user test name 1", "user test surname 1", "user1@test.com", "123456",
            "Via Reiss Romoli, 274 Torino", null, null, "usernametestalgo1", "secret", ""); // company id and department id are set after
    user2 = new User("user test name 2", "user test surname 2", "user2@test.com", "654321",
            "Via Reiss Romoli, 274 Torino", null, null, "usernametestalgo2", "secret", ""); // company id and department id are set after
    perm1 = new Permission(null, "rud"); // user id is set after
    perm2 = new Permission(null, "r"); // user id is set after
    algo1 = new Algorithm("algorithm test name 1", "algorithm test description 1", "test", Long.MIN_VALUE,
            Long.MIN_VALUE, null, null, "private", "model test 1", "sub-model test 1", "hive query test 1",
            Long.MIN_VALUE, 42, "algo.test.one.com"); // perm list and owner id are inserted after
    algo2 = new Algorithm("algorithm test name 2", "algorithm test description 2", "test", Long.MIN_VALUE,
            Long.MIN_VALUE, null, null, "private", "model test 2", "sub-model test 2", "hive query test 2",
            Long.MIN_VALUE, 42, "algo.test.two.com"); // perm list and owner id are inserted after
}

From source file:com.idylwood.utils.MathUtils.java

public static final long sign(final double d) {
    return Double.doubleToRawLongBits(d) & Long.MIN_VALUE;
}