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:eu.trentorise.smartcampus.permissionprovider.controller.GlobalDefaultExceptionHandler.java

public int getOrder() {
    return Integer.MIN_VALUE;
}

From source file:de.dev.eth0.retweeter.Distributor.java

/**
 * Distributes the tweets to all target accounts.
 *
 * @return//w  w  w. j a v a 2s  . c  o  m
 * @throws TwitterException
 */
public int distribute() throws TwitterException {
    if (!getConfig().isDistributorConfigValid()) {
        return Integer.MIN_VALUE;
    }
    Twitter twitter = getTwitter();
    String search = buildSearchString();
    Query query = new Query(search);
    QueryResult result = twitter.search(query);
    int count = 0;
    // Iterate through results
    for (Tweet tweet : result.getTweets()) {
        // Check if already distributed
        if (!distributedTweets.contains(tweet.getId())
                && StringUtils.contains(tweet.getText(), getConfig().getDistributorConfig().getHashtag())) {
            // Retweet each result to all targetaccounts
            for (String targetaccount : getConfig().getDistributorConfig().getTargetaccounts()) {
                // Dont distribute to yourself
                if (!StringUtils.equalsIgnoreCase(tweet.getFromUser(), targetaccount)) {
                    StringBuilder sb = new StringBuilder();
                    sb.append("@");
                    sb.append(targetaccount);
                    sb.append(": RT @");
                    sb.append(tweet.getFromUser());
                    sb.append(" ");
                    sb.append(tweet.getText());
                    String text = sb.toString();
                    // try to tweet, might cause an exception (status duplicate) if already tweeted
                    logger.debug("Distributing tweet {} to {}", tweet.toString(), targetaccount);
                    try {
                        twitter.updateStatus(text.length() < 140 ? text : text.substring(0, 140));
                        count++;
                    } catch (TwitterException te) {
                        logger.warn("distribute of tweet " + tweet.toString() + "failed " + text, te);
                    }
                    distributedTweets.add(tweet.getId());
                }
            }
        }
    }
    return count;
}

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:com.javacreed.examples.spring.StreamingStatementCreator.java

@Override
public PreparedStatement createPreparedStatement(final Connection connection) throws SQLException {
    final PreparedStatement statement = connection.prepareStatement(query, ResultSet.TYPE_FORWARD_ONLY,
            ResultSet.CONCUR_READ_ONLY);
    statement.setFetchSize(Integer.MIN_VALUE);
    return statement;
}

From source file:kobic.msb.swing.comparator.JMsbComparatorChain.java

@SuppressWarnings("unchecked")
public int compare(Object o1, Object o2) throws UnsupportedOperationException {
    if (isLocked == false) {
        this.checkChainIntegrity();
        isLocked = true;/*from ww w.  j a  v a 2 s. co m*/
    }

    // iterate over all comparators in the chain
    Iterator comparators = comparatorChain.iterator();
    for (int comparatorIndex = 0; comparators.hasNext(); ++comparatorIndex) {

        Comparator comparator = (Comparator) comparators.next();
        int retval = comparator.compare(o1, o2);
        if (retval != 0) {
            // invert the order if it is a reverse sort
            if (orderingBits.get(comparatorIndex) == true) {
                if (Integer.MIN_VALUE == retval) {
                    retval = Integer.MAX_VALUE;
                } else {
                    retval *= -1;
                }
            }

            return retval;
        }
    }

    // if comparators are exhausted, return 0
    return 0;
}

From source file:cf.spring.VarzHandlerMapping.java

public VarzHandlerMapping(VarzAggregator aggregator, HttpBasicAuthenticator authenticator) {
    this(aggregator, authenticator, Integer.MIN_VALUE);
}

From source file:org.openmastery.publisher.core.activity.MetadataContainer.java

public int getMetadataValueAsInteger(String key) {
    Object value = container.get(key);
    return value != null ? (Integer) value : Integer.MIN_VALUE;
}

From source file:cgpanalyser.gui.chart.XYChartPanel.java

@Override
public void setChart(JFreeChart chart) {
    super.setChart(chart);
    domainCrosshairValue = Integer.MIN_VALUE;
    if (chart != null) //because of gui builder
        setPropertiesAndListeners();//from  www. jav  a 2s.  com
}

From source file:de.dev.eth0.retweeter.Retweeter.java

/**
 * Performs the retweet-action and returns the number of tweets found with the configured hashtag
 *
 * @return number of retweeted tweets//from  w w  w . j av a  2s  .  c  o  m
 * @throws TwitterException
 */
public int retweet() throws TwitterException {
    if (!getConfig().isRetweeterConfigValid()) {
        return Integer.MIN_VALUE;
    }
    Twitter twitter = getTwitter();
    String search = buildSearchString();
    Query query = new Query(search);
    QueryResult result = twitter.search(query);

    List<Status> lastretweets = twitter.getRetweetedByMe();
    int count = 0;
    for (Tweet tweet : result.getTweets()) {
        // ignore retweets and check if the hashtag is really in the tweet's text
        if (!StringUtils.startsWith(tweet.getText(), "RT @")
                && StringUtils.contains(tweet.getText(), getConfig().getRetweeterConfig().getHashtag())
                && !ALREADY_RETWEETED.contains(tweet.getId())) {
            boolean retweeted = false;
            for (Status retweet : lastretweets) {
                if (tweet.getId() == retweet.getRetweetedStatus().getId()) {
                    retweeted = true;
                    break;
                }
            }
            if (!retweeted) {
                // try to retweet, might fail
                logger.debug("found new tweet to retweet: {}", tweet.toString());
                try {
                    twitter.retweetStatus(tweet.getId());
                    count++;
                } catch (TwitterException te) {
                    logger.debug("retweet failed", te);
                } finally {
                    ALREADY_RETWEETED.add(tweet.getId());
                }
            }
        }
    }
    return count;
}

From source file:JSplash.java

private void init() {
    JPanel pnlImage = new JPanel();
    ImageIcon image = new ImageIcon(getClass().getResource("img/logo.jpg"));
    JLabel lblBack = new JLabel(image);
    Border raisedbevel = BorderFactory.createRaisedBevelBorder();
    Border loweredbevel = BorderFactory.createLoweredBevelBorder();

    lblBack.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
    getLayeredPane().add(lblBack, new Integer(Integer.MIN_VALUE));

    pnlImage.setLayout(null);/*  ww w .j a  v a 2  s .c  o  m*/
    pnlImage.setOpaque(false);
    pnlImage.setBorder(BorderFactory.createCompoundBorder(raisedbevel, loweredbevel));

    pnlImage.add(this.lblVersion);

    this.lblVersion.setForeground(Color.white);
    this.lblVersion.setFont(new Font("Dialog", Font.PLAIN, 12));
    this.lblVersion.setBounds(15, 69, 120, 20);

    setContentPane(pnlImage);
    setSize(image.getIconWidth(), image.getIconHeight());
}