Example usage for java.lang Integer Integer

List of usage examples for java.lang Integer Integer

Introduction

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

Prototype

@Deprecated(since = "9")
public Integer(String s) throws NumberFormatException 

Source Link

Document

Constructs a newly allocated Integer object that represents the int value indicated by the String parameter.

Usage

From source file:jGW2API.util.item.Bag.java

public Bag(JSONObject json) {
    super(json);/*from  w  w w. j av a 2s .c  o m*/
    JSONObject bag = json.getJSONObject("bag");
    this.noSellOrSort = new Boolean(bag.getString("no_sell_or_sort"));
    this.size = new Integer(bag.getString("size"));
}

From source file:moviedatas.View.BarChartView.java

@Override
public void newMovieSelected(Movie movie) {
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(movie.getBudget(), "Budget", new Integer(1));
    dataset.addValue(movie.getGross(), "Gross", new Integer(1));
    JFreeChart barChart = ChartFactory.createBarChart("", "Movie", "Value (in $)", dataset, VERTICAL, true,
            true, false);//from www  .  ja v  a 2  s.co m
    cPanel.setChart(barChart);
    cPanel.updateUI();
}

From source file:net.chrisrichardson.foodToGo.domain.hibernate.HibernatePendingOrderRepositoryImpl.java

public PendingOrder findPendingOrder(String pendingOrderId) {
    return (PendingOrder) getHibernateTemplate().load(PendingOrder.class, new Integer(pendingOrderId));
}

From source file:com.wooki.services.utils.MyHostConfiguration.java

public synchronized void setProxyHostPlusPort(String proxyHostPlusPort) {

    if (null == proxyHostPlusPort)
        throw new IllegalArgumentException("proxyHostPlusPort string cannot be null");
    if (proxyHostPlusPort.indexOf(DELIMITER) == -1)
        throw new IllegalArgumentException("proxyHostPlusPort string is expected in 'host:port' format");

    String[] hostPlusPort = proxyHostPlusPort.split(DELIMITER);

    setProxy(hostPlusPort[0], new Integer(hostPlusPort[1]).intValue());
}

From source file:com.lang.pat.kafkairc.Consumer.java

public Consumer(String Topicname) {
    consumer = kafka.consumer.Consumer.createJavaConsumerConnector(createConsumerConfig());
    Topic = Topicname;/*w w  w.j  a  v a  2  s  .co  m*/
    listen = true;
    Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
    topicCountMap.put(Topic, new Integer(1));
    Map<String, List<KafkaStream<byte[], byte[]>>> consumerMap = consumer.createMessageStreams(topicCountMap);
    m_stream = consumerMap.get(Topic).get(0);
    System.out.println("Consumer for " + Topicname + " created");
}

From source file:com.pureinfo.dolphin.query.logic.SQLConditionTest.java

public void testToSQL() {
    log("to test toSQL()... ");
    SQLCondition condition = new SQLCondition(true, 3);

    //string// w w  w . j a va2s  .  c  o m
    condition.append("{this.flag}=1");

    List params = new ArrayList(1);
    params.add(new TypedValue(true));
    condition.append("{this.active}=?", params);

    SQLLogicString logic = new SQLLogicString("a>b+? and b<?");
    logic.addParameter(1);
    logic.addParameter(DataTypes.INT, new Integer(100));
    condition.append(logic);

    //comparison
    SQLComparison comparison = new SQLComparison("{b.weight}", SQLOperator.EQUAL, DataTypes.FLOAT, "1.2");
    comparison.addAlias("b");
    condition.append(comparison);

    //condition
    SQLCondition conditionOr = new SQLCondition(false, 2);
    conditionOr.append("{c.age}>12");
    conditionOr.append("{d.name} like '%snoopy%'");
    conditionOr.addAliases(new String[] { "c", "d" });
    condition.append(conditionOr);

    //toSQL
    params = new ArrayList();
    String strSQL = condition.toSQL(params);
    System.out.println("SQL=" + strSQL);
    for (int i = 0; i < params.size(); i++) {
        System.out.println("[param-" + i + "]" + params.get(i).toString());
    }
    assertEquals(5, params.size());

    String sAliases = StringUtils.join(condition.getAliases(), ",");
    System.out.println("aliases=" + sAliases);
    assertEquals("b,c,d", sAliases);

    condition.append(new SQLComparison("{a.desc}", SQLOperator.IS_EMPTY, null));
    params.clear();
    strSQL = condition.toSQL(params);
    System.out.println("SQL=" + strSQL);
    assertEquals(
            "({this.flag}=1) AND ({this.active}=?) AND (a>b+? and b<?) AND ({b.weight}>=? AND {b.weight}<=?) AND (({c.age}>12) OR ({d.name} like '%snoopy%')) AND (({a.desc} IS NULL) OR ({a.desc}=''))",
            strSQL);
}

From source file:com.log4ic.compressor.cache.filter.BrowserCacheFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    if (filterConfig != null) {
        String ct = filterConfig.getInitParameter("cache-time");
        if (StringUtils.isNotBlank(ct)) {
            this.cacheTime = new Integer(ct);
        }// w  ww.  j a  va 2s  . c o  m
    }
}

From source file:projectvendingmachine.AmountPieChart.java

/**
 * Creates a sample dataset.//from  ww  w  . ja v  a2 s. c o m
 * 
 * @return A sample dataset.
 */
private PieDataset createDataset() {
    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue("Snacks", new Integer(snackCount));
    dataset.setValue("Beverages", new Integer(beverageCount));
    dataset.setValue("Candies", new Integer(candyCount));
    //  dataset.setValue("Four", new Double(17.5));
    //  dataset.setValue("Five", new Double(11.0));
    //  dataset.setValue("Six", new Double(19.4));
    return dataset;
}

From source file:edu.harvard.i2b2.eclipse.plugins.admin.utilities.ws.CRCServiceDriver.java

/**
 * Function to send requestPdo to PFT web service
 * /*w  w w.j  av a  2  s  .  c o  m*/
 * @param requestPdo   String requestPdo to send to PFT web service
 * @return A String containing the PFT web service response 
 */
public static String getStatusReport(String request) throws Exception {
    String response = null;
    try {
        OMElement getPft = getStatusPayLoad(request);
        Options options = new Options();
        log.info("REST = " + UserInfoBean.getInstance().getCellDataUrl("ont")
                + "get_ont_process_status_request");
        options.setTo(new EndpointReference(
                UserInfoBean.getInstance().getCellDataUrl("ont") + "get_ont_process_status_request"));
        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
        options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
        options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(125000));
        options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(125000));

        ServiceClient sender = PftServiceClient.getServiceClient();
        sender.setOptions(options);

        OMElement result = sender.sendReceive(getPft);
        response = result.toString();
        log.debug("PFT response = " + response);
    } catch (AxisFault e) {
        log.error(e.getMessage());
        throw new Exception(e);
    } catch (Exception e) {
        log.error(e.getMessage());
        throw new Exception(e);
    }
    return response;
}