question: private String printXFormat ( final long x ) { String sx = null ; if ( x == Long . MIN_VALUE ) { sx = "8000000000000000" ; } else if ( x < 0 ) { final String t = Long . toString ( ( ~ ( - x - 1 ) ) ^ Long . MIN_VALUE , 16 ) ; switch ( t . length ( ) ) { case 1 : sx = "800000000000000" + t ; break ; case 2 : sx = "80000000000000" + t ; break ; case 3 : sx = "8000000000000" + t ; break ; case 4 : sx = "800000000000" + t ; break ; case 5 : sx = "80000000000" + t ; break ; case 6 : sx = "8000000000" + t ; break ; case 7 : sx = "800000000" + t ; break ; case 8 : sx = "80000000" + t ; break ; case 9 : sx = "8000000" + t ; break ; case 10 : sx = "800000" + t ; break ; case 11 : sx = "80000" + t ; break ; case 12 : sx = "8000" + t ; break ; case 13 : sx = "800" + t ; break ; case 14 : sx = "80" + t ; break ; case 15 : sx = '8' + t ; break ; case 16 : switch ( t . charAt ( 0 ) ) { case '1' : sx = '9' + t . substring ( 1 , 16 ) ; break ; case '2' : sx = 'a' + t . substring ( 1 , 16 ) ; break ; case '3' : sx = 'b' + t . substring ( 1 , 16 ) ; break ; case '4' : sx = 'c' + t . substring ( 1 , 16 ) ; break ; case '5' : sx = 'd' + t . substring ( 1 , 16 ) ; break ; case '6' : sx = 'e' + t . substring ( 1 , 16 ) ; break ; case '7' : sx = 'f' + t . substring ( 1 , 16 ) ; break ; } break ; } } else { sx = Long . toString ( x , 16 ) ; } return printXFormat ( sx ) ; }
target:  Format method for the x conversion character and long argument. For x format, the flag character '-', means that the output should be left justified within the field.  The default is to pad with blanks on the left.  The '#' flag character means to lead with '0x'. The field width is treated as the minimum number of characters to be printed.  The default is to add no padding.  Padding is with blanks by default. The precision, if set, is the minimum number of digits to appear.  Padding is with leading 0s.