1
54
55 package org.apache.poi.hpsf.wellknown;
56
57 import java.util.*;
58
59
78 public class PropertyIDMap extends HashMap
79 {
80
81
82 public static final int PID_TITLE = 2;
83 public static final int PID_SUBJECT = 3;
84 public static final int PID_AUTHOR = 4;
85 public static final int PID_KEYWORDS = 5;
86 public static final int PID_COMMENTS = 6;
87 public static final int PID_TEMPLATE = 7;
88 public static final int PID_LASTAUTHOR = 8;
89 public static final int PID_REVNUMBER = 9;
90 public static final int PID_EDITTIME = 10;
91 public static final int PID_LASTPRINTED = 11;
92 public static final int PID_CREATE_DTM = 12;
93 public static final int PID_LASTSAVE_DTM = 13;
94 public static final int PID_PAGECOUNT = 14;
95 public static final int PID_WORDCOUNT = 15;
96 public static final int PID_CHARCOUNT = 16;
97 public static final int PID_THUMBNAIL = 17;
98 public static final int PID_APPNAME = 18;
99 public static final int PID_SECURITY = 19;
100
101
102 public static final int PID_CATEGORY = 2;
103 public static final int PID_PRESFORMAT = 3;
104 public static final int PID_BYTECOUNT = 4;
105 public static final int PID_LINECOUNT = 5;
106 public static final int PID_PARCOUNT = 6;
107 public static final int PID_SLIDECOUNT = 7;
108 public static final int PID_NOTECOUNT = 8;
109 public static final int PID_HIDDENCOUNT = 9;
110 public static final int PID_MMCLIPCOUNT = 10;
111 public static final int PID_SCALE = 11;
112 public static final int PID_HEADINGPAIR = 12;
113 public static final int PID_DOCPARTS = 13;
114 public static final int PID_MANAGER = 14;
115 public static final int PID_COMPANY = 15;
116 public static final int PID_LINKSDIRTY = 16;
117
118 private static PropertyIDMap summaryInformationProperties;
119 private static PropertyIDMap documentSummaryInformationProperties;
120
121
122
123 public PropertyIDMap(int initialCapacity, float loadFactor)
124 {
125 super(initialCapacity, loadFactor);
126 }
127
128
129
130
138 public Object put(int id, String idString)
139 {
140 return put(new Integer(id), idString);
141 }
142
143
144
145
151 public Object get(int id)
152 {
153 return get(new Integer(id));
154 }
155
156
157
158
161 public static PropertyIDMap getSummaryInformationProperties()
162 {
163 if (summaryInformationProperties == null)
164 {
165 PropertyIDMap m = new PropertyIDMap(17, (float) 1.0);
166 m.put(PID_TITLE, "PID_TITLE");
167 m.put(PID_SUBJECT, "PID_SUBJECT");
168 m.put(PID_AUTHOR, "PID_AUTHOR");
169 m.put(PID_KEYWORDS, "PID_KEYWORDS");
170 m.put(PID_COMMENTS, "PID_COMMENTS");
171 m.put(PID_TEMPLATE, "PID_TEMPLATE");
172 m.put(PID_LASTAUTHOR, "PID_LASTAUTHOR");
173 m.put(PID_REVNUMBER, "PID_REVNUMBER");
174 m.put(PID_EDITTIME, "PID_EDITTIME");
175 m.put(PID_LASTPRINTED, "PID_LASTPRINTED");
176 m.put(PID_CREATE_DTM, "PID_CREATE_DTM");
177 m.put(PID_LASTSAVE_DTM, "PID_LASTSAVE_DTM");
178 m.put(PID_PAGECOUNT, "PID_PAGECOUNT");
179 m.put(PID_WORDCOUNT, "PID_WORDCOUNT");
180 m.put(PID_CHARCOUNT, "PID_CHARCOUNT");
181 m.put(PID_THUMBNAIL, "PID_THUMBNAIL");
182 m.put(PID_APPNAME, "PID_APPNAME");
183 m.put(PID_SECURITY, "PID_SECURITY");
184 summaryInformationProperties = m;
185 }
186 return summaryInformationProperties;
187 }
188
189
190
191
194 public static PropertyIDMap getDocumentSummaryInformationProperties()
195 {
196 if (documentSummaryInformationProperties == null)
197 {
198 PropertyIDMap m = new PropertyIDMap(17, (float) 1.0);
199 m.put(PID_CATEGORY, "PID_CATEGORY");
200 m.put(PID_PRESFORMAT, "PID_PRESFORMAT");
201 m.put(PID_BYTECOUNT, "PID_BYTECOUNT");
202 m.put(PID_LINECOUNT, "PID_LINECOUNT");
203 m.put(PID_PARCOUNT, "PID_PARCOUNT");
204 m.put(PID_SLIDECOUNT, "PID_SLIDECOUNT");
205 m.put(PID_NOTECOUNT, "PID_NOTECOUNT");
206 m.put(PID_HIDDENCOUNT, "PID_HIDDENCOUNT");
207 m.put(PID_MMCLIPCOUNT, "PID_MMCLIPCOUNT");
208 m.put(PID_SCALE, "PID_SCALE");
209 m.put(PID_HEADINGPAIR, "PID_HEADINGPAIR");
210 m.put(PID_DOCPARTS, "PID_DOCPARTS");
211 m.put(PID_MANAGER, "PID_MANAGER");
212 m.put(PID_COMPANY, "PID_COMPANY");
213 m.put(PID_LINKSDIRTY, "PID_LINKSDIRTY");
214 documentSummaryInformationProperties = m;
215 }
216 return documentSummaryInformationProperties;
217
218 }
219
220
221
222 public static void main(String args[])
223 {
224 PropertyIDMap s1 = getSummaryInformationProperties();
225 PropertyIDMap s2 = getDocumentSummaryInformationProperties();
226 System.out.println("s1: " + s1);
227 System.out.println("s2: " + s2);
228 }
229
230 }
231