Java Integer to String intToString(int i)

Here you can find the source of intToString(int i)

Description

Returns a String representation of an int , which is "unbounded" in case the int equals -1.

License

Open Source License

Parameter

Parameter Description
i the int to get the String representation for

Return

the String representation of the int

Declaration

public static String intToString(int i) 

Method Source Code

//package com.java2s;
/*// w w  w .ja v  a2s. c  o m
 *  This file is part of "Tweety", a collection of Java libraries for
 *  logical aspects of artificial intelligence and knowledge representation.
 *
 *  Tweety is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 3 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    /**
     * Returns a {@code String} representation of an {@code int}, which is "unbounded"
     * in case the {@code int} equals -1.
     * @param i the {@code int} to get the {@code String} representation for
     * @return the {@code String} representation of the {@code int}
     */
    public static String intToString(int i) {
        if (i == -1) {
            return "unbounded";
        } else {
            return Integer.valueOf(i).toString();
        }
    }
}

Related

  1. intToString(final int param)
  2. intToString(final int value)
  3. intToString(final Integer value)
  4. intToString(final long v, final int length)
  5. intToString(int i)
  6. intToString(int i)
  7. intToString(int integer)
  8. intToString(int n)
  9. intToString(int theValue, int nDigits)