1 2 17 18 package org.apache.poi.hpsf.wellknown; 19 20 import java.util.Collections ; 21 import java.util.HashMap ; 22 import java.util.Map ; 23 24 39 public class PropertyIDMap extends HashMap 40 { 41 42 46 47 48 public static final int PID_TITLE = 2; 49 50 51 public static final int PID_SUBJECT = 3; 52 53 54 public static final int PID_AUTHOR = 4; 55 56 57 public static final int PID_KEYWORDS = 5; 58 59 60 public static final int PID_COMMENTS = 6; 61 62 63 public static final int PID_TEMPLATE = 7; 64 65 66 public static final int PID_LASTAUTHOR = 8; 67 68 69 public static final int PID_REVNUMBER = 9; 70 71 72 public static final int PID_EDITTIME = 10; 73 74 76 public static final int PID_LASTPRINTED = 11; 77 78 80 public static final int PID_CREATE_DTM = 12; 81 82 84 public static final int PID_LASTSAVE_DTM = 13; 85 86 88 public static final int PID_PAGECOUNT = 14; 89 90 92 public static final int PID_WORDCOUNT = 15; 93 94 96 public static final int PID_CHARCOUNT = 16; 97 98 99 public static final int PID_THUMBNAIL = 17; 100 101 103 public static final int PID_APPNAME = 18; 104 105 130 public static final int PID_SECURITY = 19; 131 132 133 134 138 139 142 public static final int PID_DICTIONARY = 0; 143 144 147 public static final int PID_CODEPAGE = 1; 148 149 154 public static final int PID_CATEGORY = 2; 155 156 160 public static final int PID_PRESFORMAT = 3; 161 162 165 public static final int PID_BYTECOUNT = 4; 166 167 170 public static final int PID_LINECOUNT = 5; 171 172 175 public static final int PID_PARCOUNT = 6; 176 177 180 public static final int PID_SLIDECOUNT = 7; 181 182 185 public static final int PID_NOTECOUNT = 8; 186 187 190 public static final int PID_HIDDENCOUNT = 9; 191 192 195 public static final int PID_MMCLIPCOUNT = 10; 196 197 201 public static final int PID_SCALE = 11; 202 203 210 public static final int PID_HEADINGPAIR = 12; 211 212 217 public static final int PID_DOCPARTS = 13; 218 219 222 public static final int PID_MANAGER = 14; 223 224 227 public static final int PID_COMPANY = 15; 228 229 233 public static final int PID_LINKSDIRTY = 16; 234 235 236 237 242 private static PropertyIDMap summaryInformationProperties; 243 244 249 private static PropertyIDMap documentSummaryInformationProperties; 250 251 252 253 260 public PropertyIDMap(final int initialCapacity, final float loadFactor) 261 { 262 super(initialCapacity, loadFactor); 263 } 264 265 266 267 272 public PropertyIDMap(final Map map) 273 { 274 super(map); 275 } 276 277 278 279 290 public Object put(final long id, final String idString) 291 { 292 return put(new Long (id), idString); 293 } 294 295 296 297 304 public Object get(final long id) 305 { 306 return get(new Long (id)); 307 } 308 309 310 311 314 public static PropertyIDMap getSummaryInformationProperties() 315 { 316 if (summaryInformationProperties == null) 317 { 318 PropertyIDMap m = new PropertyIDMap(18, (float) 1.0); 319 m.put(PID_TITLE, "PID_TITLE"); 320 m.put(PID_SUBJECT, "PID_SUBJECT"); 321 m.put(PID_AUTHOR, "PID_AUTHOR"); 322 m.put(PID_KEYWORDS, "PID_KEYWORDS"); 323 m.put(PID_COMMENTS, "PID_COMMENTS"); 324 m.put(PID_TEMPLATE, "PID_TEMPLATE"); 325 m.put(PID_LASTAUTHOR, "PID_LASTAUTHOR"); 326 m.put(PID_REVNUMBER, "PID_REVNUMBER"); 327 m.put(PID_EDITTIME, "PID_EDITTIME"); 328 m.put(PID_LASTPRINTED, "PID_LASTPRINTED"); 329 m.put(PID_CREATE_DTM, "PID_CREATE_DTM"); 330 m.put(PID_LASTSAVE_DTM, "PID_LASTSAVE_DTM"); 331 m.put(PID_PAGECOUNT, "PID_PAGECOUNT"); 332 m.put(PID_WORDCOUNT, "PID_WORDCOUNT"); 333 m.put(PID_CHARCOUNT, "PID_CHARCOUNT"); 334 m.put(PID_THUMBNAIL, "PID_THUMBNAIL"); 335 m.put(PID_APPNAME, "PID_APPNAME"); 336 m.put(PID_SECURITY, "PID_SECURITY"); 337 summaryInformationProperties = 338 new PropertyIDMap(Collections.unmodifiableMap(m)); 339 } 340 return summaryInformationProperties; 341 } 342 343 344 345 351 public static PropertyIDMap getDocumentSummaryInformationProperties() 352 { 353 if (documentSummaryInformationProperties == null) 354 { 355 PropertyIDMap m = new PropertyIDMap(17, (float) 1.0); 356 m.put(PID_DICTIONARY, "PID_DICTIONARY"); 357 m.put(PID_CODEPAGE, "PID_CODEPAGE"); 358 m.put(PID_CATEGORY, "PID_CATEGORY"); 359 m.put(PID_PRESFORMAT, "PID_PRESFORMAT"); 360 m.put(PID_BYTECOUNT, "PID_BYTECOUNT"); 361 m.put(PID_LINECOUNT, "PID_LINECOUNT"); 362 m.put(PID_PARCOUNT, "PID_PARCOUNT"); 363 m.put(PID_SLIDECOUNT, "PID_SLIDECOUNT"); 364 m.put(PID_NOTECOUNT, "PID_NOTECOUNT"); 365 m.put(PID_HIDDENCOUNT, "PID_HIDDENCOUNT"); 366 m.put(PID_MMCLIPCOUNT, "PID_MMCLIPCOUNT"); 367 m.put(PID_SCALE, "PID_SCALE"); 368 m.put(PID_HEADINGPAIR, "PID_HEADINGPAIR"); 369 m.put(PID_DOCPARTS, "PID_DOCPARTS"); 370 m.put(PID_MANAGER, "PID_MANAGER"); 371 m.put(PID_COMPANY, "PID_COMPANY"); 372 m.put(PID_LINKSDIRTY, "PID_LINKSDIRTY"); 373 documentSummaryInformationProperties = 374 new PropertyIDMap(Collections.unmodifiableMap(m)); 375 } 376 return documentSummaryInformationProperties; 377 } 378 379 380 381 386 public static void main(final String [] args) 387 { 388 PropertyIDMap s1 = getSummaryInformationProperties(); 389 PropertyIDMap s2 = getDocumentSummaryInformationProperties(); 390 System.out.println("s1: " + s1); 391 System.out.println("s2: " + s2); 392 } 393 394 } 395 | Popular Tags |