Java Utililty Methods Integer Create

List of utility methods to do Integer Create

Description

The list of methods to do Integer Create are organized into topic(s).

Method

StringtoInternalName(String className)
to Internal Name
return dotsToSlashes(className);
StringtoInternalName(String fullName)
to Internal Name
return fullName.replace('.', '/');
StringtoInternalString(String s)
to Internal String
String newString;
if (s.charAt(0) == '"') {
    int len = s.length();
    int bufferLen = 0;
    char[] buffer = new char[len];
    for (int i = 1; i < len - 1; ++i) {
        char c = s.charAt(i);
        if (c == '\\') {
...
longtoInternalValue(final double value)
Converts the given AWT value into a strict value.
final long rounded = StrictMath.round(value * 10000f);
return StrictMath.round(rounded * CORRECTION_FACTOR / 10000.0);
StringtoInternalVariableName(String varName)
to Internal Variable Name
return USER_VAR_PREFIX + varName;
StringtoInternLink(String title, String url)
to Intern Link
if (url.startsWith("www."))
    url = "http://" + url;
return "<a class=\"i-tw-link\" href=\"" + url + "\">" + title + "</a>";
StringtoInterval(long i)
to Interval
if (i < 60)
    return i + "S";
if (i < 3600)
    return (i / 60) + "M";
return (i / 3600) + "H";
inttoIntExact(long value)
to Int Exact
if ((int) value != value) {
    throw new ArithmeticException("integer overflow");
return (int) value;
StringtoIntExp(String charExp)
Transform a char regexp into an int regexp w.r.t.
StringBuilder b = new StringBuilder(32);
for (int i = 0; i < charExp.length(); i++) {
    char c = charExp.charAt(i);
    if (c == '(' || c == ')' || c == '*' || c == '+' || c == '|') {
        b.append(c);
    } else {
        int n = (int) c;
        if (n >= 35)
...
IntegertoIntFormat(String value)
Convert from a String holding a double value of the form D.DDDDDDD into an Integer of the form : DDDDDDDD
Double dVal = Double.valueOf(value);
return Integer.valueOf((int) (100000000.0 * dVal.doubleValue()));