MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / hex4

Method hex4

chapter19/src/main/java/com/seaofnodes/simple/SB.java:33–40  ·  view source on GitHub ↗
(int s)

Source from the content-addressed store, hash-verified

31 public SB p( boolean s) { _sb.append(s); return this; }
32 // 4 hex digits
33 public SB hex4(int s) {
34 assert (s>>4*4)==0; // Fits in 16 bits
35 for( int i=0; i<4; i++ ) {
36 int digit = (s>>((3-i)*4)) & 0xf;
37 _sb.append((char)((digit <= 9 ? '0' : ('A'-10))+digit));
38 }
39 return this;
40 }
41 // Fixed width field
42 public SB fix( int sz, String s ) {
43 assert sz >=0;

Callers 1

doInstMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected