Example usage for java.lang Integer MIN_VALUE

List of usage examples for java.lang Integer MIN_VALUE

Introduction

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

Prototype

int MIN_VALUE

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

Click Source Link

Document

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

Usage

From source file:Main.java

/**
 * Creates a color states-list.//ww w.  ja  va2s. c  om
 * 
 * @param color
 * @return A state-list
 */
public static ColorStateList createColorStateList(int color) {
    // @formatter:off
    // FIXME - This is buggy. The minute we set the color in, the button is no longer clickable....
    //   [[-16842910], [16842908, -16842910], [16842919], [16842913], [16842908], []]
    //  [-2147483648,      -2147483648,          -1,         -1,        -1,   -16777216]
    return new ColorStateList(
            new int[][] { new int[] { -android.R.attr.state_enabled },
                    new int[] { android.R.attr.state_focused, -android.R.attr.state_enabled },
                    new int[] { android.R.attr.state_pressed }, new int[] { android.R.attr.state_selected },
                    new int[] { android.R.attr.state_focused }, new int[0] },
            new int[] { Integer.MIN_VALUE, // !enabled
                    Integer.MIN_VALUE, // focused & !enabled
                    Color.WHITE, // pressed
                    Color.WHITE, // selected
                    Color.WHITE, // focused
                    color });

    // @formatter:on
}

From source file:org.glom.web.server.Utils.java

public static int safeLongToInt(final long value) {
    if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
        throw new IllegalArgumentException(value + " cannot be cast to int without changing its value.");
    }/* w ww  . j  a  va  2s  .co  m*/
    return (int) value;
}

From source file:ardufocuser.starfocusing.Utils.java

/**
 * Calcula valores de luz maximos y minimos de la regin de la matriz imagen  delimitada por startX - endX  y startY- endY ..
 *//*w  w  w.  ja  v a  2  s . co  m*/

public static int[] computeMinMax(int[][] pixels, int startX, int startY, int endX, int endY) {
    int min = Integer.MIN_VALUE;
    int max = Integer.MAX_VALUE;

    for (int x = startX; x < endX; x++) {
        for (int y = startY; y < endY; y++) {
            if (min > pixels[x][y]) {
                min = pixels[x][y];
            }
            if (max < pixels[x][y]) {
                max = pixels[x][y];
            }
        }
    }

    return new int[] { min, max };
}

From source file:com.repaskys.domain.ShortUrl.java

/**
 * Helper method.//from   w ww  .  ja va 2 s. com
 * 
 * @see http://stackoverflow.com/questions/1590831/safely-casting-long-to-int-in-java
 */
private static int safeLongToInt(long l) {
    if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) {
        throw new IllegalArgumentException(l + " cannot be cast to int without changing its value.");
    }
    return (int) l;
}

From source file:io.galeb.core.entity.RuleOrder.java

public RuleOrder() {
    this(Long.MIN_VALUE, Integer.MIN_VALUE);
}

From source file:com.fitbur.core.el.spring.internal.SpelParserConfigurationProvider.java

@Rank(Integer.MIN_VALUE)
@Singleton
@Override
public SpelParserConfiguration provide() {
    return new SpelParserConfiguration(false, false);
}

From source file:com.fitbur.core.el.spring.internal.StandardEvaluationContextProvider.java

@Rank(Integer.MIN_VALUE)
@PerLookup
@Override
public StandardEvaluationContext provide() {
    return new StandardEvaluationContext();
}

From source file:com.fitbur.core.el.spring.internal.TemplateParserContextProvider.java

@Rank(Integer.MIN_VALUE)
@Singleton
@Override
public ParserContext provide() {
    return new TemplateParserContext();
}

From source file:cc.softwarefactory.lokki.android.utilities.gcm.GcmHelper.java

private static String getRegistrationId(Context context) {

    final SharedPreferences prefs = getGCMPreferences(context);
    String registrationId = prefs.getString(PROPERTY_REG_ID, "");
    if (registrationId.isEmpty()) {
        Log.e(TAG, "Registration not found.");
        return "";
    }/*from www .j  av a  2 s.c  o m*/
    // Check if app was updated; if so, it must clear the registration ID since the existing regID is not guaranteed to work with the new app version.
    int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
    int currentVersion = getAppVersion(context);
    if (registeredVersion == currentVersion) {
        return registrationId;
    }
    Log.i(TAG, "App version changed.");
    return "";
}

From source file:cf.spring.HealthzHandlerMapping.java

public HealthzHandlerMapping() {
    this(Integer.MIN_VALUE);
}