question: private String printXFormat ( short x ) { String sx = null ; if ( x == Short . MIN_VALUE ) sx = "8000" ; else if ( x < 0 ) { String t ; if ( x == Short . MIN_VALUE ) t = "0" ; else { t = Integer . toString ( ( ~ ( - x - 1 ) ) ^ Short . MIN_VALUE , 16 ) ; if ( t . charAt ( 0 ) == 'F' || t . charAt ( 0 ) == 'f' ) t = t . substring ( 16 , 32 ) ; } switch ( t . length ( ) ) { case 1 : sx = "800" + t ; break ; case 2 : sx = "80" + t ; break ; case 3 : sx = "8" + t ; break ; case 4 : switch ( t . charAt ( 0 ) ) { case '1' : sx = "9" + t . substring ( 1 , 4 ) ; break ; case '2' : sx = "a" + t . substring ( 1 , 4 ) ; break ; case '3' : sx = "b" + t . substring ( 1 , 4 ) ; break ; case '4' : sx = "c" + t . substring ( 1 , 4 ) ; break ; case '5' : sx = "d" + t . substring ( 1 , 4 ) ; break ; case '6' : sx = "e" + t . substring ( 1 , 4 ) ; break ; case '7' : sx = "f" + t . substring ( 1 , 4 ) ; break ; } break ; } } else sx = Integer . toString ( x , 16 ) ; return printXFormat ( sx ) ; }
target:  Format method for the x conversion character and short argument. <p/> 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'. <p/> 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. <p/> The precision, if set, is the minimum number of digits to appear.  Padding is with leading 0s.