Example usage for java.lang Integer toString

List of usage examples for java.lang Integer toString

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a String object representing this Integer 's value.

Usage

From source file:org.openmrs.module.DeIdentifiedPatientDataExportModule.web.controller.DeIdentifiedPatientDataExportModuleManageController.java

@RequestMapping(value = "/module/DeIdentifiedPatientDataExportModule/new", method = RequestMethod.GET)
public void new_manage(HttpServletResponse response, HttpServletRequest request) {

    String ids = "";
    String ab = request.getParameter("patientId");
    System.out.println("ids" + ids);
    DeIdentifiedExportService d = Context.getService(DeIdentifiedExportService.class);
    ids = request.getParameter("listPatientIds");
    int flag = 0;
    String a = request.getParameter("format");
    String c = request.getParameter("cohort");
    String pn = request.getParameter("profileName");
    int idP = d.getProfileIdByName(pn);
    List<String> list = d.getConceptsByCategoryByPid("PersonAttribute", idP);

    String b = request.getParameter("patientInput");
    List<Integer> idList = new ArrayList<Integer>();
    StringBuffer sb = new StringBuffer("");
    //d.exportCohort();
    if (b.contentEquals("single")) {
        ids = request.getParameter("patientId");
    } else if (b.contentEquals("multiple")) {
        ids = request.getParameter("listPatientIds");
    }/*from   w  ww .  j  av a2 s . co m*/

    else if (b.contentEquals("cohort")) {
        flag = 1;
        int id = Integer.parseInt(c);
        CohortService cs = Context.getCohortService();
        Cohort cohort = cs.getCohort(id);
        Set<Integer> cohortSet = cohort.getMemberIds();

        for (Integer i : cohortSet) {
            sb.append(i.toString());
            sb.append(",");
        }

    }

    if (a.contentEquals("json")) {
        if (flag == 1)
            ids = sb.toString();
        d.exportJson(response, ids, idP);

    }

    else if (a.contentEquals("sql")) {
        if (flag == 1)
            ids = sb.toString();
        d.generatePatientSQL(response, ids, idP);
    }

    else {
        if (flag == 1)
            ids = sb.toString();
        d.extractPatientData(response, ids, idP);
    }

}

From source file:com.manning.androidhacks.hack027.NumbersAdapter.java

@Override
public View getView(int position, View cv, ViewGroup parent) {

    if (null == cv) {
        cv = mInflator.inflate(R.layout.number_row, parent, false);
    }//from  w  w  w.ja  va  2s . c  o  m

    final Integer value = getItem(position);
    TextView tv = (TextView) cv.findViewById(R.id.numbers_row_text);
    tv.setText(value.toString());

    View button = cv.findViewById(R.id.numbers_row_button);
    button.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (null != mDelegate) {
                mDelegate.removeItem(value);
            }
        }
    });

    return cv;
}

From source file:com.heliumv.factory.impl.JudgeCall.java

private LockMeDto buildLockMeDto(String lockedTable, Integer id) {
    LockMeDto lockmeDto = new LockMeDto(lockedTable, id.toString(), globalInfo.getTheClientDto().getIDUser());
    lockmeDto.setPersonalIIdLocker(globalInfo.getTheClientDto().getIDPersonal());
    return lockmeDto;
}

From source file:com.opengamma.analytics.financial.curve.CurveConstructionXCcyTest.java

private static String[] getCurvesNameSwapIborIbor(String[][] curveNames, Integer unit, int block) {
    if (block != 2) {
        switch (unit) {
        case 2:/*from w ww.  j av a2s  .  c  o  m*/
            return new String[] { curveNames[2][0], curveNames[2][1], curveNames[2][2] };
        default:
            throw new IllegalArgumentException(unit.toString());
        }
    }
    return new String[] { curveNames[0][2], curveNames[0][3], curveNames[0][4] };
}

From source file:com.clxcommunications.xms.BatchDeliveryReportParams.java

/**
 * Formats this filter as an URL encoded list of query parameters.
 * //ww  w  . j a  va2 s. c om
 * @param page
 *            the page to request
 * @return a list of query parameters
 */
@Nonnull
List<NameValuePair> toQueryParams() {
    ArrayList<NameValuePair> params = new ArrayList<NameValuePair>(6);

    if (reportType() != null) {
        params.add(new BasicNameValuePair("type", reportType().name().toLowerCase(Locale.US)));
    }

    if (!statuses().isEmpty()) {
        ArrayList<String> statusStrings = new ArrayList<String>(statuses().size());

        for (DeliveryStatus s : statuses()) {
            statusStrings.add(s.status());
        }

        params.add(new BasicNameValuePair("status", Utils.join(",", statusStrings)));
    }

    if (!codes().isEmpty()) {
        ArrayList<String> codeStrings = new ArrayList<String>(codes().size());

        for (Integer code : codes()) {
            codeStrings.add(code.toString());
        }

        params.add(new BasicNameValuePair("code", Utils.join(",", codeStrings)));
    }

    return params;
}

From source file:com.couchbase.sqoop.mapreduce.db.CouchbaseRecordReadSerializeTest.java

@Before
@Override// w  w  w .  j  a va2s . co m
public void setUp() throws Exception {
    super.setUp();

    tappedStuff = new HashMap<String, ResponseMessage>();

    URI uri = new URI(CouchbaseUtils.CONNECT_STRING);
    String user = CouchbaseUtils.COUCHBASE_USER_NAME;
    String pass = CouchbaseUtils.COUCHBASE_USER_PASS;

    try {
        cb = new CouchbaseClient(Arrays.asList(uri), user, pass);
    } catch (IOException e) {
        LOG.error("Couldn't connect to server" + e.getMessage());
        fail(e.toString());
    }
    this.client = new TapClient(Arrays.asList(uri), user, pass);

    cb.flush();
    Thread.sleep(500);

    // set up the items we're going to deserialize
    Integer anint = new Integer(Integer.MIN_VALUE);
    cb.set(anint.toString(), 0x300, anint).get();

    Long along = new Long(Long.MAX_VALUE);
    cb.set(along.toString(), 0, along).get();

    Float afloat = new Float(Float.MAX_VALUE);
    cb.set(afloat.toString(), 0, afloat).get();

    Double doubleBase = new Double(Double.NEGATIVE_INFINITY);
    cb.set(doubleBase.toString(), 0, doubleBase).get();

    Boolean booleanBase = true;
    cb.set(booleanBase.toString(), 0, booleanBase).get();

    rightnow = new Date(); // instance, needed later
    dateText = rightnow.toString().replaceAll(" ", "_");
    cb.set(dateText, 0, rightnow).get();

    Byte byteMeSix = new Byte("6");
    cb.set(byteMeSix.toString(), 0, byteMeSix).get();

    String ourString = "hi,there";
    cb.set(ourString.toString(), 0, ourString).get();

    client.tapDump("tester");
    while (client.hasMoreMessages()) {
        ResponseMessage m = client.getNextMessage();
        if (m == null) {
            continue;
        }
        tappedStuff.put(m.getKey(), m);
    }
}

From source file:br.ufpe.cin.emergo.instrument.bitrep.BitConfigRep.java

@Override
public String toString() {
    StringBuffer b = new StringBuffer();

    Collection<Integer> collection = atoms.values();

    for (Integer v : collection) {
        if (v.toString().contains(Integer.toString(id))) {
            b.append(atoms.getKey(v));/*  w  w  w. j a  v a2  s  .  com*/
        }
    }

    b.append((b.length() == 0) ? "ROOT" : "");

    return b.toString();
}

From source file:com.opengamma.analytics.financial.curve.CurveConstructionXCcyTest.java

private static String[] getCurvesNameSwapFixedON(String[][] curveNames, Integer unit) {
    switch (unit) {
    case 0:/*from  w  ww .  ja  v  a  2 s .  com*/
        return new String[] { curveNames[0][0], curveNames[0][0] };
    case 2:
        return new String[] { curveNames[2][0], curveNames[2][0] };
    default:
        throw new IllegalArgumentException(unit.toString());
    }
}

From source file:com.quancheng.saluki.core.config.RpcServiceConfig.java

private void addInterval(Map<String, String> params) {
    Integer interval = getMonitorinterval();
    if (interval != 0) {
        params.put(Constants.MONITOR_INTERVAL, interval.toString());
    }//from   w w  w.jav  a  2 s  .  com
}

From source file:copter.GpioControl.java

public String togglePinState(Integer pinNumber) {
    getOutputPin(pinNumber).toggle();/*from   w w w . j  a v  a 2s  .co m*/
    return "Toggle GPIO pin #" + pinNumber.toString() + " state";
}