1 19 20 package jxl.biff; 21 22 import jxl.format.Format; 23 24 32 final class BuiltInFormat implements Format, DisplayFormat 33 { 34 37 private String formatString; 38 39 42 private int formatIndex; 43 44 50 private BuiltInFormat(String s, int i) 51 { 52 formatIndex = i; 53 formatString = s; 54 } 55 56 63 public String getFormatString() 64 { 65 return formatString; 66 } 67 68 73 public int getFormatIndex() 74 { 75 return formatIndex; 76 } 77 82 public boolean isInitialized() 83 { 84 return true; 85 } 86 91 public void initialize(int pos) 92 { 93 } 94 95 100 public boolean isBuiltIn() 101 { 102 return true; 103 } 104 105 108 public static BuiltInFormat[] builtIns = new BuiltInFormat[0x32]; 109 110 static 112 { 113 builtIns[0x0] = new BuiltInFormat("", 0); 114 builtIns[0x1] = new BuiltInFormat("0", 1); 115 builtIns[0x2] = new BuiltInFormat("0.00", 2); 116 builtIns[0x3] = new BuiltInFormat("#,##0", 3); 117 builtIns[0x4] = new BuiltInFormat("#,##0.00", 4); 118 builtIns[0x5] = new BuiltInFormat("($#,##0_);($#,##0)", 5); 119 builtIns[0x6] = new BuiltInFormat("($#,##0_);[Red]($#,##0)", 6); 120 builtIns[0x7] = new BuiltInFormat("($#,##0_);[Red]($#,##0)", 7); 121 builtIns[0x8] = new BuiltInFormat("($#,##0.00_);[Red]($#,##0.00)", 8); 122 builtIns[0x9] = new BuiltInFormat("0%", 9); 123 builtIns[0xa] = new BuiltInFormat("0.00%", 10); 124 builtIns[0xb] = new BuiltInFormat("0.00E+00", 11); 125 builtIns[0xc] = new BuiltInFormat("# ?/?", 12); 126 builtIns[0xd] = new BuiltInFormat("# ??/??", 13); 127 builtIns[0xe] = new BuiltInFormat("dd/mm/yyyy", 14); 128 builtIns[0xf] = new BuiltInFormat("d-mmm-yy", 15); 129 builtIns[0x10] = new BuiltInFormat("d-mmm", 16); 130 builtIns[0x11] = new BuiltInFormat("mmm-yy", 17); 131 builtIns[0x12] = new BuiltInFormat("h:mm AM/PM", 18); 132 builtIns[0x13] = new BuiltInFormat("h:mm:ss AM/PM", 19); 133 builtIns[0x14] = new BuiltInFormat("h:mm", 20); 134 builtIns[0x15] = new BuiltInFormat("h:mm:ss", 21); 135 builtIns[0x16] = new BuiltInFormat("m/d/yy h:mm", 22); 136 builtIns[0x25] = new BuiltInFormat("(#,##0_);(#,##0)", 0x25); 137 builtIns[0x26] = new BuiltInFormat("(#,##0_);[Red](#,##0)", 0x26); 138 builtIns[0x27] = new BuiltInFormat("(#,##0.00_);(#,##0.00)", 0x27); 139 builtIns[0x28] = new BuiltInFormat("(#,##0.00_);[Red](#,##0.00)", 0x28); 140 builtIns[0x29] = new BuiltInFormat 141 ("_(*#,##0_);_(*(#,##0);_(*\"-\"_);(@_)", 0x29); 142 builtIns[0x2a] = new BuiltInFormat 143 ("_($*#,##0_);_($*(#,##0);_($*\"-\"_);(@_)", 0x2a); 144 builtIns[0x2b] = new BuiltInFormat 145 ("_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);(@_)", 0x2b); 146 builtIns[0x2c] = new BuiltInFormat 147 ("_($* #,##0.00_);_($* (#,##0.00);_($* \"-\"??_);(@_)", 0x2c); 148 builtIns[0x2d] = new BuiltInFormat("mm:ss", 0x2d); 149 builtIns[0x2e] = new BuiltInFormat("[h]mm:ss", 0x2e); 150 builtIns[0x2f] = new BuiltInFormat("mm:ss.0", 0x2f); 151 builtIns[0x30] = new BuiltInFormat("##0.0E+0", 0x30); 152 builtIns[0x31] = new BuiltInFormat("@", 0x31); 153 } 154 } 155 156 | Popular Tags |