Java Hex Calculate toHexOrNegative(int i)

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

Description

to Hex Or Negative

License

Open Source License

Declaration

public static String toHexOrNegative(int i) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String toHexOrNegative(int i) {
        return toHex(i, "-1");
    }//from  w w  w .  j a  v  a2s. c  o m

    public static String toHex(int i, String $default) {
        return i != -1 ? Integer.toHexString(i) : $default;
    }

    public static String toHex(int i) {
        return Integer.toHexString(i);
    }

    public static String toHex(long n) {
        return Long.toHexString(n);
    }
}

Related

  1. toHexFromOct(final String octSymbols)
  2. toHexHashString(byte[] id)
  3. toHexLiteral(int v)
  4. toHexN(long src, int hexn)
  5. ToHexNumber(int c)
  6. toHexPadZero(byte[] bytes)
  7. toHexShortString(byte[] bytes)
  8. toHexStr(byte b[])
  9. toHexStr(byte[] b)