Example usage for java.lang Integer MAX_VALUE

List of usage examples for java.lang Integer MAX_VALUE

Introduction

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

Prototype

int MAX_VALUE

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

Click Source Link

Document

A constant holding the maximum value an int can have, 231-1.

Usage

From source file:com.cognifide.slice.persistence.impl.serializer.RecursiveSerializer.java

@Override
public int getPriority() {
    return Integer.MAX_VALUE;
}

From source file:com.zrquan.mobile.widget.viewpager.ImagePagerAdapter.java

@Override
public int getCount() {
    // Infinite loop
    return isInfiniteLoop ? Integer.MAX_VALUE : CollectionUtils.size(imageIdList);
}

From source file:com.joyent.manta.benchmark.RandomInputStream.java

@Override
public int read() throws IOException {
    if (count.getAndIncrement() >= maximumBytes) {
        return EOF;
    }/* w  w  w .  jav a2s. c o m*/

    return RandomUtils.nextInt(0, Integer.MAX_VALUE);
}

From source file:com.ms.commons.test.math.expression.util.MathExpressionParseUtil.java

private static Stack<String> adjustExpressionStack(Stack<String> expressionStack) {
    if (expressionStack.size() <= 2) {
        return expressionStack;
    }/*www .ja  va 2  s  . c  o m*/
    int lastOpPr = Integer.MAX_VALUE;
    int lowerPrOp = -1;
    for (int i = (expressionStack.size() - 1); i >= 0; i--) {
        String expr = expressionStack.get(i);
        if ((expr.length() == 1) && hasSeparators(expr)) {
            int opPr = ("*".equals(expr) || "/".equals(expr)) ? 2 : 1;
            if (opPr < lastOpPr) {
                lastOpPr = opPr;
                lowerPrOp = i;
            }
        }
    }
    if (lowerPrOp != -1) {
        Stack<String> tempStack = new Stack<String>();
        int popCount = expressionStack.size() - lowerPrOp - 1;
        for (int i = 0; i < popCount; i++) {
            tempStack.push(expressionStack.pop());
        }
        Collections.reverse(tempStack);
        expressionStack.push(StringUtils.join(tempStack, ""));
    }

    return expressionStack;
}

From source file:de.unihannover.se.processSimulation.dataGenerator.StatisticsUtil.java

static int qBinom(double q, int trials, double p) {
    try {//from  www .j  a  v a2 s  .  c  o  m
        final BinomialDistribution d = new BinomialDistributionImpl(trials, p);
        final int result = d.inverseCumulativeProbability(q);
        if (result == -1) {
            return 0;
        } else if (result == Integer.MAX_VALUE) {
            return trials;
        } else {
            return result + 1;
        }
    } catch (final MathException e) {
        throw new RuntimeException(e);
    }
}

From source file:com.redhat.smonkey.RndInt.java

@Override
public JsonNode generate(JsonNodeFactory nodeFactory, JsonNode data, Monkey mon) {
    int min = Utils.asInt(data.get("min"), Integer.MIN_VALUE);
    int max = Utils.asInt(data.get("max"), Integer.MAX_VALUE);
    long x = Utils.rndi(min, max);
    return nodeFactory.numberNode(x);
}

From source file:fr.pasteque.client.models.Payment.java

public Payment(PaymentMode mode, double amount, double given) {
    this.mode = mode;
    this.amount = amount;
    this.given = given;
    this.innerId = (int) (Math.random() * Integer.MAX_VALUE);
}

From source file:ch.cyberduck.core.AbstractCache.java

public AbstractCache(int size) {
    if (size == Integer.MAX_VALUE) {
        // Unlimited
        impl = Collections.synchronizedMap(new LinkedHashMap<T, AttributedList<T>>());
        reverse = Collections.synchronizedMap(new LinkedHashMap<CacheReference, T>());
    } else if (size == 0) {
        impl = Collections.emptyMap();
        reverse = Collections.emptyMap();
    } else {/*from  w w w .  j  a v  a 2 s. c o  m*/
        // Will inflate to the given size
        impl = Collections.synchronizedMap(new LRUMap<T, AttributedList<T>>(size));
        reverse = Collections.synchronizedMap(new LinkedHashMap<CacheReference, T>());
    }
}

From source file:br.ufpe.cin.srmqnlp.CarrotConsoleFormatter.java

public static void displayClusters(final Collection<Cluster> clusters) {
    displayClusters(clusters, Integer.MAX_VALUE);
}

From source file:com.sirius.hadoop.job.onlinetime.StatusKeyPartitioner.java

@Override
public int getPartition(StatusKey key, NullWritable nullWritable, int numPartitions) {
    return (key.userId.hashCode() & Integer.MAX_VALUE) % numPartitions;
}