View Javadoc

1   package com.sharkysoft.printf;
2   
3   import com.sharkysoft.printf.engine.NumberFormatter;
4   import com.sharkysoft.util.UnreachableCodeException;
5   
6   class Formatter_z extends Formatter_Integer
7   {
8   
9     Formatter_z(final FormatSpecifier ipPfs)
10    {
11      super(ipPfs);
12      final NumberFormatter vpNf = (NumberFormatter) mpFormatter;
13      vpNf.setRadix(ipPfs.mnBase);
14      switch (ipPfs.mcType)
15      {
16      case 'z' :
17        vpNf.setUpperCase(false);
18        break;
19      case 'Z' :
20        vpNf.setUpperCase(true);
21        break;
22      default :
23        throw new UnreachableCodeException();
24      }
25    }
26  
27    void format(final PrintfState ipPs)
28    {
29      formatUnsignedInt(ipPs);
30    }
31    
32  }
33