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:de.undercouch.citeproc.helper.Levenshtein.java

/**
 * Searches the given collection of strings and returns the string that
 * has the lowest Levenshtein distance to a given second string <code>t</code>.
 * If the collection contains multiple strings with the same distance to
 * <code>t</code> only the first one will be returned.
 * @param <T> the type of the strings in the given collection
 * @param ss the collection to search//from  ww  w .j a  va2s.c  o m
 * @param t the second string
 * @return the string with the lowest Levenshtein distance
 */
public static <T extends CharSequence> T findMinimum(Collection<T> ss, CharSequence t) {
    int min = Integer.MAX_VALUE;
    T result = null;
    for (T s : ss) {
        int d = StringUtils.getLevenshteinDistance(s, t);
        if (d < min) {
            min = d;
            result = s;
        }
    }
    return result;
}

From source file:importer.filters.PoemFilter.java

public PoemFilter() {
    super();
    minStanzaLength = Integer.MAX_VALUE;
}

From source file:com.netflix.astyanax.thrift.ThriftUtils.java

public static SliceRange createAllInclusiveSliceRange() {
    return new SliceRange(EMPTY_BYTE_BUFFER, EMPTY_BYTE_BUFFER, false, Integer.MAX_VALUE);
}

From source file:at.molindo.notify.util.AbstractSmartLifecycle.java

@Override
public int getPhase() {
    return Integer.MAX_VALUE; // at the very end
}

From source file:JToolbarSeparator.java

/**
 * Creates a new JToolbarSeparator object.
 */
public JToolbarSeparator() {
    setMaximumSize(new Dimension(15, Integer.MAX_VALUE));
}

From source file:com.facebook.infrastructure.db.CommitLogHeader.java

static int getLowestPosition(CommitLogHeader clHeader) {
    int[] positions = clHeader.getPositions();
    int minPosition = Integer.MAX_VALUE;
    for (int position : positions) {
        if (position < minPosition && position > 0) {
            minPosition = position;/*from  w  ww .  j  ava2 s .c o m*/
        }
    }

    if (minPosition == Integer.MAX_VALUE)
        minPosition = 0;
    return minPosition;
}

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:controllers.SvnApp.java

@With(BasicAuthAction.class)
@BodyParser.Of(value = BodyParser.Raw.class, maxLength = Integer.MAX_VALUE)
public static Result serviceWithPath(String path) throws ServletException, IOException, InterruptedException {
    return service();
}

From source file:Main.java

/**
 * Read text file from its InputStream.//from www  . j  av  a  2  s.  c  om
 */
public static String readFile(InputStream inputStream) {
    return readFile(inputStream, Integer.MAX_VALUE);
}

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

public Cache(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 www .j a va2s .  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>());
    }
}