Java Long to String longToString(final long value)

Here you can find the source of longToString(final long value)

Description

Convert a long into an ASM HEX representation

License

Open Source License

Parameter

Parameter Description
value a long value to be converted

Return

a hex string representation of the long

Declaration

public static String longToString(final long value) 

Method Source Code

//package com.java2s;
/*//from   ww  w  . j a v a2 s.c o m
 * Copyright 2012 Igor Maznitsa (http://www.igormaznitsa.com)
 * 
 * This file is part of the JVM to Z80 translator project (hereinafter referred to as J2Z80).
 *
 * J2Z80 is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * J2Z80 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 J2Z80.  If not, see <http://www.gnu.org/licenses/>. 
 */

public class Main {
    /**
     * Convert a long into an ASM HEX representation
     *
     * @param value a long value to be converted
     * @return a hex string representation of the long
     */
    public static String longToString(final long value) {
        final StringBuilder result = new StringBuilder();

        result.append(value).append("(#").append(Long.toHexString(value).toUpperCase()).append(')');

        return result.toString();
    }
}

Related

  1. long2string(long longdata)
  2. long2String(long x)
  3. long2StringForLen(long num, String str)
  4. long2Word(long val)
  5. LongToStr(long nValue)
  6. longToString(long l)
  7. longToString(long l)
  8. LongToString(Long l, int length)
  9. longToString(long li)