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