PageRenderTime 41ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/projects/netbeans-7.3/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/uid/UIDObjectFactory.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus
Java | 1105 lines | 984 code | 68 blank | 53 comment | 120 complexity | b59bc4f28323b325af7e50bf8b51682c MD5 | raw file
  1. /*
  2. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  3. *
  4. * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
  5. *
  6. * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  7. * Other names may be trademarks of their respective owners.
  8. *
  9. * The contents of this file are subject to the terms of either the GNU
  10. * General Public License Version 2 only ("GPL") or the Common
  11. * Development and Distribution License("CDDL") (collectively, the
  12. * "License"). You may not use this file except in compliance with the
  13. * License. You can obtain a copy of the License at
  14. * http://www.netbeans.org/cddl-gplv2.html
  15. * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  16. * specific language governing permissions and limitations under the
  17. * License. When distributing the software, include this License Header
  18. * Notice in each file and include the License file at
  19. * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
  20. * particular file as subject to the "Classpath" exception as provided
  21. * by Oracle in the GPL Version 2 section of the License file that
  22. * accompanied this code. If applicable, add the following below the
  23. * License Header, with the fields enclosed by brackets [] replaced by
  24. * your own identifying information:
  25. * "Portions Copyrighted [year] [name of copyright owner]"
  26. *
  27. * Contributor(s):
  28. *
  29. * The Original Software is NetBeans. The Initial Developer of the Original
  30. * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
  31. * Microsystems, Inc. All Rights Reserved.
  32. *
  33. * If you wish your version of this file to be governed by only the CDDL
  34. * or only the GPL Version 2, indicate your decision by adding
  35. * "[Contributor] elects to include this software in this distribution
  36. * under the [CDDL or GPL Version 2] license." If you do not indicate a
  37. * single choice of license, a recipient has the option to distribute
  38. * your version of this file under either the CDDL, the GPL Version 2 or
  39. * to extend the choice of license to its licensees as provided above.
  40. * However, if you add GPL Version 2 code and therefore, elected the GPL
  41. * Version 2 license, then the option applies only if the new code is
  42. * made subject to such option by the copyright holder.
  43. */
  44. package org.netbeans.modules.cnd.modelimpl.uid;
  45. import java.io.IOException;
  46. import java.util.ArrayList;
  47. import java.util.Collection;
  48. import java.util.Comparator;
  49. import java.util.HashMap;
  50. import java.util.HashSet;
  51. import java.util.Iterator;
  52. import java.util.Map;
  53. import java.util.Map.Entry;
  54. import java.util.Set;
  55. import java.util.SortedMap;
  56. import java.util.TreeMap;
  57. import org.netbeans.modules.cnd.api.model.CsmFile;
  58. import org.netbeans.modules.cnd.api.model.CsmMacro;
  59. import org.netbeans.modules.cnd.api.model.CsmNamespaceDefinition;
  60. import org.netbeans.modules.cnd.api.model.CsmObject;
  61. import org.netbeans.modules.cnd.api.model.CsmOffsetableDeclaration;
  62. import org.netbeans.modules.cnd.api.model.CsmUID;
  63. import org.netbeans.modules.cnd.utils.cache.APTStringManager;
  64. import org.netbeans.modules.cnd.modelimpl.csm.BuiltinTypes;
  65. import org.netbeans.modules.cnd.modelimpl.csm.BuiltinTypes.BuiltInUID;
  66. import org.netbeans.modules.cnd.modelimpl.csm.Instantiation;
  67. import org.netbeans.modules.cnd.modelimpl.csm.Instantiation.InstantiationSelfUID;
  68. import org.netbeans.modules.cnd.modelimpl.csm.NamespaceImpl;
  69. import org.netbeans.modules.cnd.modelimpl.csm.NamespaceImpl.FileNameSortedKey;
  70. import org.netbeans.modules.cnd.modelimpl.content.file.FileComponentDeclarations.OffsetSortedKey;
  71. import org.netbeans.modules.cnd.modelimpl.content.file.FileComponentMacros.NameSortedKey;
  72. import org.netbeans.modules.cnd.modelimpl.content.file.FileComponentReferences.ReferenceImpl;
  73. import org.netbeans.modules.cnd.modelimpl.repository.KeyObjectFactory;
  74. import org.netbeans.modules.cnd.modelimpl.repository.PersistentUtils;
  75. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.ForwardClassUID;
  76. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.ClassifierUID;
  77. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.DeclarationUID;
  78. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.FileUID;
  79. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.IncludeUID;
  80. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.InheritanceUID;
  81. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.InstantiationUID;
  82. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.MacroUID;
  83. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.NamespaceUID;
  84. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.ProjectUID;
  85. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.TypedefUID;
  86. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.UnnamedClassifierUID;
  87. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.UnnamedOffsetableDeclarationUID;
  88. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.UnresolvedClassUID;
  89. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.UnresolvedFileUID;
  90. import org.netbeans.modules.cnd.modelimpl.uid.UIDUtilities.UnresolvedNamespaceUID;
  91. import org.netbeans.modules.cnd.repository.spi.RepositoryDataInput;
  92. import org.netbeans.modules.cnd.repository.spi.RepositoryDataOutput;
  93. import org.netbeans.modules.cnd.repository.support.AbstractObjectFactory;
  94. import org.netbeans.modules.cnd.repository.support.SelfPersistent;
  95. import org.netbeans.modules.cnd.utils.CndUtils;
  96. import org.openide.util.CharSequences;
  97. import org.openide.util.Exceptions;
  98. /**
  99. *
  100. * @author Nickolay Dalmatov
  101. */
  102. public class UIDObjectFactory extends AbstractObjectFactory {
  103. private static UIDObjectFactory theFactory;
  104. /** Creates a new instance of UIDObjectFactory */
  105. protected UIDObjectFactory() {
  106. }
  107. public static UIDObjectFactory getDefaultFactory() {
  108. UIDObjectFactory out = theFactory;
  109. if (out == null) {
  110. out = theFactory;
  111. synchronized (UIDObjectFactory.class) {
  112. out = theFactory;
  113. if (out == null) {
  114. theFactory = out = new UIDObjectFactory();
  115. }
  116. }
  117. }
  118. return theFactory;
  119. }
  120. public void writeUID(CsmUID<?> anUID, RepositoryDataOutput aStream) throws IOException {
  121. if (!(anUID == null || anUID instanceof SelfPersistent)) {
  122. CndUtils.assertTrue(false, anUID + ", " + (anUID == null ? "NULL UID" : anUID.getObject()));
  123. return;
  124. }
  125. super.writeSelfPersistent((SelfPersistent) anUID, aStream);
  126. }
  127. @SuppressWarnings("unchecked") // okay
  128. public <T> CsmUID<T> readUID(RepositoryDataInput aStream) throws IOException {
  129. assert aStream != null;
  130. SelfPersistent out = super.readSelfPersistent(aStream);
  131. assert out == null || out instanceof CsmUID<?>;
  132. return (CsmUID<T>) out;
  133. }
  134. public <T> void writeUIDCollection(Collection<CsmUID<T>> aCollection, RepositoryDataOutput aStream, boolean sync) throws IOException {
  135. assert aStream != null;
  136. if (aCollection == null) {
  137. aStream.writeInt(NULL_POINTER);
  138. } else {
  139. aCollection = sync ? copySyncCollection(aCollection) : aCollection;
  140. int collSize = aCollection.size();
  141. aStream.writeInt(collSize);
  142. for (CsmUID<T> uid : aCollection) {
  143. assert uid != null;
  144. writeUID(uid, aStream);
  145. }
  146. }
  147. }
  148. public <A, T extends Collection<CsmUID<A>>> T readUIDCollection(T aCollection, RepositoryDataInput aStream) throws IOException {
  149. assert aCollection != null;
  150. assert aStream != null;
  151. int collSize = aStream.readInt();
  152. return readUIDCollection(aCollection, aStream, collSize);
  153. }
  154. public <A, T extends Collection<CsmUID<A>>> T readUIDCollection(T aCollection, RepositoryDataInput aStream, int collSize) throws IOException {
  155. if (collSize == NULL_POINTER) {
  156. return null;
  157. } else {
  158. for (int i = 0; i < collSize; ++i) {
  159. CsmUID<A> anUID = readUID(aStream);
  160. assert anUID != null;
  161. aCollection.add(anUID);
  162. }
  163. return aCollection;
  164. }
  165. }
  166. public <T> void writeStringToUIDMap(Map<CharSequence, CsmUID<T>> aMap, RepositoryDataOutput aStream, boolean sync) throws IOException {
  167. assert aMap != null;
  168. assert aStream != null;
  169. aMap = sync ? copySyncMap(aMap) : aMap;
  170. int collSize = aMap.size();
  171. aStream.writeInt(collSize);
  172. for (Map.Entry<CharSequence, CsmUID<T>> anEntry : aMap.entrySet()) {
  173. CharSequence key = anEntry.getKey();
  174. assert key != null;
  175. PersistentUtils.writeUTF(key, aStream);
  176. CsmUID<T> anUID = anEntry.getValue();
  177. assert anUID != null;
  178. writeUID(anUID, aStream);
  179. }
  180. }
  181. public <T> void writeStringToUIDMapSet(Map<CharSequence, Set<CsmUID<T>>> aMap, RepositoryDataOutput aStream) throws IOException {
  182. assert aMap != null;
  183. assert aStream != null;
  184. int collSize = aMap.size();
  185. aStream.writeInt(collSize);
  186. for (Map.Entry<CharSequence, Set<CsmUID<T>>> anEntry : aMap.entrySet()) {
  187. CharSequence key = anEntry.getKey();
  188. assert key != null;
  189. PersistentUtils.writeUTF(key, aStream);
  190. collSize = anEntry.getValue().size();
  191. aStream.writeInt(collSize);
  192. for(CsmUID<T> anUID : anEntry.getValue()) {
  193. assert anUID != null;
  194. writeUID(anUID, aStream);
  195. }
  196. }
  197. }
  198. public <T> void writeOffsetSortedToUIDMap(Map<OffsetSortedKey, CsmUID<T>> aMap, RepositoryDataOutput aStream, boolean sync) throws IOException {
  199. assert aMap != null;
  200. assert aStream != null;
  201. aMap = sync ? copySyncMap(aMap) : aMap;
  202. int collSize = aMap.size();
  203. aStream.writeInt(collSize);
  204. for (Map.Entry<OffsetSortedKey, CsmUID<T>> anEntry : aMap.entrySet()) {
  205. anEntry.getKey().write(aStream);
  206. CsmUID<T> anUID = anEntry.getValue();
  207. assert anUID != null;
  208. writeUID(anUID, aStream);
  209. }
  210. }
  211. public <T> void writeNameSortedToUIDMap(Map<NameSortedKey, CsmUID<T>> aMap, RepositoryDataOutput aStream, boolean sync) throws IOException {
  212. assert aMap != null;
  213. assert aStream != null;
  214. aMap = sync ? copySyncMap(aMap) : aMap;
  215. int collSize = aMap.size();
  216. aStream.writeInt(collSize);
  217. for (Map.Entry<NameSortedKey, CsmUID<T>> anEntry : aMap.entrySet()) {
  218. anEntry.getKey().write(aStream);
  219. CsmUID<T> anUID = anEntry.getValue();
  220. assert anUID != null;
  221. writeUID(anUID, aStream);
  222. }
  223. }
  224. public <T> void writeNameSortedToUIDMap2(Map<NamespaceImpl.FileNameSortedKey, CsmUID<T>> aMap, RepositoryDataOutput aStream, boolean sync) throws IOException {
  225. assert aMap != null;
  226. assert aStream != null;
  227. aMap = sync ? copySyncMap(aMap) : aMap;
  228. int collSize = aMap.size();
  229. aStream.writeInt(collSize);
  230. for (Map.Entry<NamespaceImpl.FileNameSortedKey, CsmUID<T>> anEntry : aMap.entrySet()) {
  231. anEntry.getKey().write(aStream);
  232. CsmUID<T> anUID = anEntry.getValue();
  233. assert anUID != null;
  234. writeUID(anUID, aStream);
  235. }
  236. }
  237. public void writeStringToArrayUIDMap(Map<CharSequence, Object> aMap, RepositoryDataOutput aStream, boolean sync) throws IOException {
  238. assert aMap != null;
  239. assert aStream != null;
  240. aMap = sync ? copySyncMap(aMap) : aMap;
  241. int collSize = aMap.size();
  242. aStream.writeInt(collSize);
  243. for (Map.Entry<CharSequence, Object> anEntry : aMap.entrySet()) {
  244. CharSequence key = anEntry.getKey();
  245. assert key != null;
  246. PersistentUtils.writeUTF(key, aStream);
  247. Object o = anEntry.getValue();
  248. if (o instanceof CsmUID<?>) {
  249. aStream.writeInt(1);
  250. writeUID((CsmUID<?>) o, aStream);
  251. } else {
  252. CsmUID<?>[] arr = (CsmUID<?>[]) o;
  253. aStream.writeInt(arr.length);
  254. for (CsmUID<?> uid : arr) {
  255. assert uid != null;
  256. writeUID(uid, aStream);
  257. }
  258. }
  259. }
  260. }
  261. private static <T> Collection<CsmUID<T>> copySyncCollection(Collection<CsmUID<T>> col) {
  262. Collection<CsmUID<T>> out;
  263. synchronized (col) {
  264. out = new ArrayList<CsmUID<T>>(col);
  265. }
  266. return out;
  267. }
  268. private static <K, V> Map<K, V> copySyncMap(Map<K, V> map) {
  269. Map<K, V> out;
  270. synchronized (map) {
  271. out = new HashMap<K, V>(map);
  272. }
  273. return out;
  274. }
  275. public <T> void readStringToUIDMap(Map<CharSequence, CsmUID<T>> aMap, RepositoryDataInput aStream, APTStringManager manager, int collSize) throws IOException {
  276. for (int i = 0; i < collSize; ++i) {
  277. CharSequence key = PersistentUtils.readUTF(aStream, manager);
  278. assert key != null;
  279. CsmUID<T> uid = readUID(aStream);
  280. assert uid != null;
  281. aMap.put(key, uid);
  282. }
  283. }
  284. public <T> void readStringToUIDMapSet(Map<CharSequence, Set<CsmUID<T>>> aMap, RepositoryDataInput aStream, APTStringManager manager, int collSize) throws IOException {
  285. for (int i = 0; i < collSize; ++i) {
  286. CharSequence key = PersistentUtils.readUTF(aStream, manager);
  287. assert key != null;
  288. int aSize = aStream.readInt();
  289. Set<CsmUID<T>> set = new HashSet<CsmUID<T>>(aSize);
  290. for(int j = 0; j < aSize; j++) {
  291. CsmUID<T> uid = readUID(aStream);
  292. assert uid != null;
  293. set.add(uid);
  294. }
  295. aMap.put(key, set);
  296. }
  297. }
  298. public TreeMap<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>> readOffsetSortedToUIDMap(RepositoryDataInput aStream, APTStringManager manager) throws IOException {
  299. assert aStream != null;
  300. HelperDeclarationsSortedMap helper = new HelperDeclarationsSortedMap(this, aStream, manager);
  301. return new TreeMap<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>>(helper);
  302. }
  303. public TreeMap<NameSortedKey, CsmUID<CsmMacro>> readNameSortedToUIDMap(RepositoryDataInput aStream, APTStringManager manager) throws IOException {
  304. assert aStream != null;
  305. HelperMacrosSortedMap helper = new HelperMacrosSortedMap(this, aStream, manager);
  306. return new TreeMap<NameSortedKey, CsmUID<CsmMacro>>(helper);
  307. }
  308. public TreeMap<ReferenceImpl, CsmUID<CsmObject>> readReferencesSortedToUIDMap(RepositoryDataInput aStream, CsmUID<CsmFile> fileUID) throws IOException {
  309. assert aStream != null;
  310. HelperReferencesSortedMap helper = new HelperReferencesSortedMap(this, aStream, fileUID);
  311. return new TreeMap<ReferenceImpl, CsmUID<CsmObject>>(helper);
  312. }
  313. public TreeMap<NamespaceImpl.FileNameSortedKey, CsmUID<CsmNamespaceDefinition>> readNameSortedToUIDMap2(RepositoryDataInput aStream, APTStringManager manager) throws IOException {
  314. assert aStream != null;
  315. HelperNamespaceDefinitionSortedMap helper = new HelperNamespaceDefinitionSortedMap(this, aStream, manager);
  316. return new TreeMap<NamespaceImpl.FileNameSortedKey, CsmUID<CsmNamespaceDefinition>>(helper);
  317. }
  318. public TreeMap<CharSequence, Object> readStringToArrayUIDMap(RepositoryDataInput aStream, APTStringManager manager) throws IOException {
  319. assert aStream != null;
  320. HelperCharSequencesSortedMap helper = new HelperCharSequencesSortedMap(this, aStream, manager);
  321. return new TreeMap<CharSequence, Object>(helper);
  322. }
  323. public TreeMap<CharSequence,CsmUID<CsmNamespaceDefinition>> readStringToUIDMap(RepositoryDataInput aStream, APTStringManager manager) throws IOException {
  324. assert aStream != null;
  325. HelperCharSequencesSortedMap2 helper = new HelperCharSequencesSortedMap2(this, aStream, manager);
  326. return new TreeMap<CharSequence,CsmUID<CsmNamespaceDefinition>>(helper);
  327. }
  328. @Override
  329. protected int getHandler(Object object) {
  330. int aHandler;
  331. if (object instanceof ProjectUID) {
  332. aHandler = UID_PROJECT_UID;
  333. } else if (object instanceof NamespaceUID) {
  334. aHandler = UID_NAMESPACE_UID;
  335. } else if (object instanceof FileUID) {
  336. aHandler = UID_FILE_UID;
  337. } else if (object instanceof TypedefUID) {
  338. aHandler = UID_TYPEDEF_UID;
  339. } else if (object instanceof ClassifierUID<?>) {
  340. aHandler = UID_CLASSIFIER_UID;
  341. } else if (object instanceof ForwardClassUID<?>) {
  342. aHandler = UID_FORWARD_CLASS_UID;
  343. } else if (object instanceof UnnamedClassifierUID<?>) {
  344. aHandler = UID_UNNAMED_CLASSIFIER_UID;
  345. } else if (object instanceof MacroUID) {
  346. aHandler = UID_MACRO_UID;
  347. } else if (object instanceof IncludeUID) {
  348. aHandler = UID_INCLUDE_UID;
  349. } else if (object instanceof UIDUtilities.InheritanceUID) {
  350. aHandler = UID_INHERITANCE_UID;
  351. } else if (object instanceof UnnamedOffsetableDeclarationUID<?>) {
  352. aHandler = UID_UNNAMED_OFFSETABLE_DECLARATION_UID;
  353. } else if (object instanceof DeclarationUID<?>) {
  354. aHandler = UID_DECLARATION_UID;
  355. } else if (object instanceof BuiltInUID) {
  356. aHandler = UID_BUILT_IN_UID;
  357. } else if (object instanceof InstantiationSelfUID) {
  358. aHandler = UID_INSTANTIATION_SELF_UID;
  359. } else if (object instanceof InstantiationUID) {
  360. aHandler = UID_INSTANTIATION_UID;
  361. } else if (object instanceof UnresolvedClassUID) {
  362. aHandler = UID_UNRESOLVED_CLASS;
  363. } else if (object instanceof UnresolvedFileUID) {
  364. aHandler = UID_UNRESOLVED_FILE;
  365. } else if (object instanceof UnresolvedNamespaceUID) {
  366. aHandler = UID_UNRESOLVED_NAMESPACE;
  367. } else {
  368. throw new IllegalArgumentException("The UID is an instance of unknow class"); //NOI18N
  369. }
  370. return aHandler;
  371. }
  372. @Override
  373. protected SelfPersistent createObject(int handler, RepositoryDataInput aStream) throws IOException {
  374. SelfPersistent anUID;
  375. boolean share = false;
  376. switch (handler) {
  377. case UID_PROJECT_UID:
  378. share = true;
  379. anUID = new ProjectUID(aStream);
  380. break;
  381. case UID_NAMESPACE_UID:
  382. share = true;
  383. anUID = new NamespaceUID(aStream);
  384. break;
  385. case UID_FILE_UID:
  386. share = true;
  387. anUID = new FileUID(aStream);
  388. break;
  389. case UID_TYPEDEF_UID:
  390. anUID = new TypedefUID(aStream);
  391. break;
  392. case UID_CLASSIFIER_UID:
  393. anUID = new ClassifierUID<CsmOffsetableDeclaration>(aStream);
  394. break;
  395. case UID_FORWARD_CLASS_UID:
  396. anUID = new ForwardClassUID<CsmOffsetableDeclaration>(aStream);
  397. break;
  398. case UID_UNNAMED_CLASSIFIER_UID:
  399. anUID = new UnnamedClassifierUID<CsmOffsetableDeclaration>(aStream);
  400. break;
  401. case UID_MACRO_UID:
  402. share = true;
  403. anUID = new MacroUID(aStream);
  404. break;
  405. case UID_INCLUDE_UID:
  406. share = true;
  407. anUID = new IncludeUID(aStream);
  408. break;
  409. case UID_INHERITANCE_UID:
  410. share = true;
  411. anUID = new InheritanceUID(aStream);
  412. break;
  413. // no reason to cache declaration and more detailed uids.
  414. case UID_UNNAMED_OFFSETABLE_DECLARATION_UID:
  415. anUID = new UnnamedOffsetableDeclarationUID<CsmOffsetableDeclaration>(aStream);
  416. break;
  417. case UID_DECLARATION_UID:
  418. anUID = new DeclarationUID<CsmOffsetableDeclaration>(aStream);
  419. break;
  420. case UID_BUILT_IN_UID:
  421. anUID = (SelfPersistent) BuiltinTypes.readUID(aStream);
  422. share = false;
  423. break;
  424. case UID_INSTANTIATION_SELF_UID:
  425. anUID = new Instantiation.InstantiationSelfUID(aStream);
  426. share = false;
  427. break;
  428. case UID_INSTANTIATION_UID:
  429. anUID = new InstantiationUID(aStream);
  430. share = false;
  431. break;
  432. case UID_UNRESOLVED_CLASS:
  433. anUID = new UIDUtilities.UnresolvedClassUID(aStream);
  434. break;
  435. case UID_UNRESOLVED_FILE:
  436. anUID = new UIDUtilities.UnresolvedFileUID(aStream);
  437. break;
  438. case UID_UNRESOLVED_NAMESPACE:
  439. anUID = new UIDUtilities.UnresolvedNamespaceUID(aStream);
  440. break;
  441. default:
  442. throw new IllegalArgumentException("The UID is an instance of unknown class: " + handler); //NOI18N
  443. }
  444. if (share) {
  445. assert anUID != null;
  446. assert anUID instanceof CsmUID<?>;
  447. CsmUID<?> shared = UIDManager.instance().getSharedUID((CsmUID<?>) anUID);
  448. assert shared != null;
  449. assert shared instanceof SelfPersistent;
  450. anUID = (SelfPersistent) shared;
  451. }
  452. return anUID;
  453. }
  454. ///////////////////////////////////////////////////////////////////////////////////////////
  455. // constants which defines the handle of an UID in the stream
  456. private static final int FIRST_INDEX = KeyObjectFactory.LAST_INDEX + 1;
  457. private static final int UID_PROJECT_UID = FIRST_INDEX;
  458. private static final int UID_NAMESPACE_UID = UID_PROJECT_UID + 1;
  459. private static final int UID_FILE_UID = UID_NAMESPACE_UID + 1;
  460. private static final int UID_TYPEDEF_UID = UID_FILE_UID + 1;
  461. private static final int UID_CLASSIFIER_UID = UID_TYPEDEF_UID + 1;
  462. private static final int UID_FORWARD_CLASS_UID = UID_CLASSIFIER_UID + 1;
  463. private static final int UID_UNNAMED_CLASSIFIER_UID = UID_FORWARD_CLASS_UID + 1;
  464. private static final int UID_MACRO_UID = UID_UNNAMED_CLASSIFIER_UID + 1;
  465. private static final int UID_INCLUDE_UID = UID_MACRO_UID + 1;
  466. private static final int UID_INHERITANCE_UID = UID_INCLUDE_UID + 1;
  467. private static final int UID_UNNAMED_OFFSETABLE_DECLARATION_UID = UID_INHERITANCE_UID + 1;
  468. private static final int UID_DECLARATION_UID = UID_UNNAMED_OFFSETABLE_DECLARATION_UID + 1;
  469. private static final int UID_BUILT_IN_UID = UID_DECLARATION_UID + 1;
  470. private static final int UID_INSTANTIATION_UID = UID_BUILT_IN_UID + 1;
  471. private static final int UID_INSTANTIATION_SELF_UID = UID_INSTANTIATION_UID + 1;
  472. private static final int UID_UNRESOLVED_CLASS = UID_INSTANTIATION_SELF_UID + 1;
  473. private static final int UID_UNRESOLVED_FILE = UID_UNRESOLVED_CLASS + 1;
  474. private static final int UID_UNRESOLVED_NAMESPACE = UID_UNRESOLVED_FILE + 1;
  475. // index to be used in another factory (but only in one)
  476. // to start own indeces from the next after LAST_INDEX
  477. public static final int LAST_INDEX = UID_UNRESOLVED_NAMESPACE;
  478. private static final Comparator<OffsetSortedKey> OSKComparator = new Comparator<OffsetSortedKey>() {
  479. @Override
  480. public int compare(OffsetSortedKey o1, OffsetSortedKey o2) {
  481. return o1.compareTo(o2);
  482. }
  483. };
  484. private static final class HelperDeclarationsSortedMap implements SortedMap<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>> {
  485. private final RepositoryDataInput aStream;
  486. private final int size;
  487. private final UIDObjectFactory factory;
  488. private final APTStringManager manager;
  489. private HelperDeclarationsSortedMap(UIDObjectFactory factory, RepositoryDataInput aStream, APTStringManager manager) throws IOException {
  490. size = aStream.readInt();
  491. this.aStream = aStream;
  492. this.factory = factory;
  493. this.manager = manager;
  494. }
  495. @Override
  496. public Comparator<? super OffsetSortedKey> comparator() {
  497. return OSKComparator;
  498. }
  499. @Override
  500. public SortedMap<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>> subMap(OffsetSortedKey fromKey, OffsetSortedKey toKey) {
  501. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  502. }
  503. @Override
  504. public SortedMap<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>> headMap(OffsetSortedKey toKey) {
  505. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  506. }
  507. @Override
  508. public SortedMap<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>> tailMap(OffsetSortedKey fromKey) {
  509. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  510. }
  511. @Override
  512. public OffsetSortedKey firstKey() {
  513. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  514. }
  515. @Override
  516. public OffsetSortedKey lastKey() {
  517. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  518. }
  519. @Override
  520. public int size() {
  521. return size;
  522. }
  523. @Override
  524. public boolean isEmpty() {
  525. return size == 0;
  526. }
  527. @Override
  528. public boolean containsKey(Object key) {
  529. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  530. }
  531. @Override
  532. public boolean containsValue(Object value) {
  533. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  534. }
  535. @Override
  536. public CsmUID<CsmOffsetableDeclaration> get(Object key) {
  537. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  538. }
  539. @Override
  540. public CsmUID<CsmOffsetableDeclaration> put(OffsetSortedKey key, CsmUID<CsmOffsetableDeclaration> value) {
  541. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  542. }
  543. @Override
  544. public CsmUID<CsmOffsetableDeclaration> remove(Object key) {
  545. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  546. }
  547. @Override
  548. public void putAll(Map<? extends OffsetSortedKey, ? extends CsmUID<CsmOffsetableDeclaration>> t) {
  549. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  550. }
  551. @Override
  552. public void clear() {
  553. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  554. }
  555. @Override
  556. public Set<OffsetSortedKey> keySet() {
  557. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  558. }
  559. @Override
  560. public Collection<CsmUID<CsmOffsetableDeclaration>> values() {
  561. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  562. }
  563. @Override
  564. public Set<Entry<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>>> entrySet() {
  565. return new Set<Entry<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>>>(){
  566. @Override
  567. public int size() {
  568. return size;
  569. }
  570. @Override
  571. public boolean isEmpty() {
  572. return size == 0;
  573. }
  574. @Override
  575. public boolean contains(Object o) {
  576. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  577. }
  578. @Override
  579. public Iterator<Entry<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>>> iterator() {
  580. return new Iterator<Entry<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>>>(){
  581. private int current = 0;
  582. @Override
  583. public boolean hasNext() {
  584. return current < size;
  585. }
  586. @Override
  587. public Entry<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>> next() {
  588. if (current < size) {
  589. current++;
  590. try {
  591. final OffsetSortedKey key = new OffsetSortedKey(aStream);
  592. assert key != null;
  593. final CsmUID<CsmOffsetableDeclaration> uid = factory.<CsmOffsetableDeclaration>readUID(aStream);
  594. assert uid != null;
  595. return new Map.Entry<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>>(){
  596. @Override
  597. public OffsetSortedKey getKey() {
  598. return key;
  599. }
  600. @Override
  601. public CsmUID<CsmOffsetableDeclaration> getValue() {
  602. return uid;
  603. }
  604. @Override
  605. public CsmUID<CsmOffsetableDeclaration> setValue(CsmUID<CsmOffsetableDeclaration> value) {
  606. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  607. }
  608. };
  609. } catch (IOException ex) {
  610. Exceptions.printStackTrace(ex);
  611. }
  612. }
  613. return null;
  614. }
  615. @Override
  616. public void remove() {
  617. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  618. }
  619. };
  620. }
  621. @Override
  622. public Object[] toArray() {
  623. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  624. }
  625. @Override
  626. public <T> T[] toArray(T[] a) {
  627. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  628. }
  629. @Override
  630. public boolean add(Entry<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>> o) {
  631. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  632. }
  633. @Override
  634. public boolean remove(Object o) {
  635. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  636. }
  637. @Override
  638. public boolean containsAll(Collection<?> c) {
  639. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  640. }
  641. @Override
  642. public boolean addAll(Collection<? extends Entry<OffsetSortedKey, CsmUID<CsmOffsetableDeclaration>>> c) {
  643. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  644. }
  645. @Override
  646. public boolean retainAll(Collection<?> c) {
  647. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  648. }
  649. @Override
  650. public boolean removeAll(Collection<?> c) {
  651. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  652. }
  653. @Override
  654. public void clear() {
  655. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  656. }
  657. };
  658. }
  659. }
  660. private static final Comparator<NameSortedKey> NSKComparator = new Comparator<NameSortedKey>() {
  661. @Override
  662. public int compare(NameSortedKey o1, NameSortedKey o2) {
  663. return o1.compareTo(o2);
  664. }
  665. };
  666. private static final class HelperMacrosSortedMap implements SortedMap<NameSortedKey, CsmUID<CsmMacro>> {
  667. private final RepositoryDataInput aStream;
  668. private final int size;
  669. private final UIDObjectFactory factory;
  670. private final APTStringManager manager;
  671. private HelperMacrosSortedMap(UIDObjectFactory factory, RepositoryDataInput aStream, APTStringManager manager) throws IOException {
  672. size = aStream.readInt();
  673. this.aStream = aStream;
  674. this.factory = factory;
  675. this.manager = manager;
  676. }
  677. @Override
  678. public Comparator<? super NameSortedKey> comparator() {
  679. return NSKComparator;
  680. }
  681. @Override
  682. public SortedMap<NameSortedKey, CsmUID<CsmMacro>> subMap(NameSortedKey fromKey, NameSortedKey toKey) {
  683. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  684. }
  685. @Override
  686. public SortedMap<NameSortedKey, CsmUID<CsmMacro>> headMap(NameSortedKey toKey) {
  687. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  688. }
  689. @Override
  690. public SortedMap<NameSortedKey, CsmUID<CsmMacro>> tailMap(NameSortedKey fromKey) {
  691. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  692. }
  693. @Override
  694. public NameSortedKey firstKey() {
  695. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  696. }
  697. @Override
  698. public NameSortedKey lastKey() {
  699. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  700. }
  701. @Override
  702. public int size() {
  703. return size;
  704. }
  705. @Override
  706. public boolean isEmpty() {
  707. return size > 0;
  708. }
  709. @Override
  710. public boolean containsKey(Object key) {
  711. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  712. }
  713. @Override
  714. public boolean containsValue(Object value) {
  715. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  716. }
  717. @Override
  718. public CsmUID<CsmMacro> get(Object key) {
  719. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  720. }
  721. @Override
  722. public CsmUID<CsmMacro> put(NameSortedKey key, CsmUID<CsmMacro> value) {
  723. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  724. }
  725. @Override
  726. public CsmUID<CsmMacro> remove(Object key) {
  727. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  728. }
  729. @Override
  730. public void putAll(Map<? extends NameSortedKey, ? extends CsmUID<CsmMacro>> t) {
  731. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  732. }
  733. @Override
  734. public void clear() {
  735. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  736. }
  737. @Override
  738. public Set<NameSortedKey> keySet() {
  739. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  740. }
  741. @Override
  742. public Collection<CsmUID<CsmMacro>> values() {
  743. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  744. }
  745. @Override
  746. public Set<Entry<NameSortedKey, CsmUID<CsmMacro>>> entrySet() {
  747. return new Set<Entry<NameSortedKey, CsmUID<CsmMacro>>>(){
  748. @Override
  749. public int size() {
  750. return size;
  751. }
  752. @Override
  753. public boolean isEmpty() {
  754. return size > 0;
  755. }
  756. @Override
  757. public boolean contains(Object o) {
  758. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  759. }
  760. @Override
  761. public Iterator<Entry<NameSortedKey, CsmUID<CsmMacro>>> iterator() {
  762. return new Iterator<Entry<NameSortedKey, CsmUID<CsmMacro>>>(){
  763. private int current = 0;
  764. @Override
  765. public boolean hasNext() {
  766. return current < size;
  767. }
  768. @Override
  769. public Entry<NameSortedKey, CsmUID<CsmMacro>> next() {
  770. if (current < size) {
  771. current++;
  772. try {
  773. final NameSortedKey key = new NameSortedKey(aStream);
  774. assert key != null;
  775. final CsmUID<CsmMacro> uid = factory.<CsmMacro>readUID(aStream);
  776. assert uid != null;
  777. return new Map.Entry<NameSortedKey, CsmUID<CsmMacro>>(){
  778. @Override
  779. public NameSortedKey getKey() {
  780. return key;
  781. }
  782. @Override
  783. public CsmUID<CsmMacro> getValue() {
  784. return uid;
  785. }
  786. @Override
  787. public CsmUID<CsmMacro> setValue(CsmUID<CsmMacro> value) {
  788. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  789. }
  790. };
  791. } catch (IOException ex) {
  792. Exceptions.printStackTrace(ex);
  793. }
  794. }
  795. return null;
  796. }
  797. @Override
  798. public void remove() {
  799. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  800. }
  801. };
  802. }
  803. @Override
  804. public Object[] toArray() {
  805. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  806. }
  807. @Override
  808. public <T> T[] toArray(T[] a) {
  809. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  810. }
  811. @Override
  812. public boolean add(Entry<NameSortedKey, CsmUID<CsmMacro>> o) {
  813. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  814. }
  815. @Override
  816. public boolean remove(Object o) {
  817. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  818. }
  819. @Override
  820. public boolean containsAll(Collection<?> c) {
  821. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  822. }
  823. @Override
  824. public boolean addAll(Collection<? extends Entry<NameSortedKey, CsmUID<CsmMacro>>> c) {
  825. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  826. }
  827. @Override
  828. public boolean retainAll(Collection<?> c) {
  829. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  830. }
  831. @Override
  832. public boolean removeAll(Collection<?> c) {
  833. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  834. }
  835. @Override
  836. public void clear() {
  837. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  838. }
  839. };
  840. }
  841. }
  842. private static final class HelperNamespaceDefinitionSortedMap implements SortedMap<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>> {
  843. private final RepositoryDataInput aStream;
  844. private final int size;
  845. private final UIDObjectFactory factory;
  846. private final APTStringManager manager;
  847. private HelperNamespaceDefinitionSortedMap(UIDObjectFactory factory, RepositoryDataInput aStream, APTStringManager manager) throws IOException {
  848. size = aStream.readInt();
  849. this.aStream = aStream;
  850. this.factory = factory;
  851. this.manager = manager;
  852. }
  853. @Override
  854. public Comparator<? super FileNameSortedKey> comparator() {
  855. return NamespaceImpl.defenitionComparator;
  856. }
  857. @Override
  858. public SortedMap<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>> subMap(FileNameSortedKey fromKey, FileNameSortedKey toKey) {
  859. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  860. }
  861. @Override
  862. public SortedMap<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>> headMap(FileNameSortedKey toKey) {
  863. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  864. }
  865. @Override
  866. public SortedMap<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>> tailMap(FileNameSortedKey fromKey) {
  867. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  868. }
  869. @Override
  870. public FileNameSortedKey firstKey() {
  871. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  872. }
  873. @Override
  874. public FileNameSortedKey lastKey() {
  875. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  876. }
  877. @Override
  878. public int size() {
  879. return size;
  880. }
  881. @Override
  882. public boolean isEmpty() {
  883. return size == 0;
  884. }
  885. @Override
  886. public boolean containsKey(Object key) {
  887. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  888. }
  889. @Override
  890. public boolean containsValue(Object value) {
  891. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  892. }
  893. @Override
  894. public CsmUID<CsmNamespaceDefinition> get(Object key) {
  895. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  896. }
  897. @Override
  898. public CsmUID<CsmNamespaceDefinition> put(FileNameSortedKey key, CsmUID<CsmNamespaceDefinition> value) {
  899. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  900. }
  901. @Override
  902. public CsmUID<CsmNamespaceDefinition> remove(Object key) {
  903. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  904. }
  905. @Override
  906. public void putAll(Map<? extends FileNameSortedKey, ? extends CsmUID<CsmNamespaceDefinition>> t) {
  907. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  908. }
  909. @Override
  910. public void clear() {
  911. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  912. }
  913. @Override
  914. public Set<FileNameSortedKey> keySet() {
  915. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  916. }
  917. @Override
  918. public Collection<CsmUID<CsmNamespaceDefinition>> values() {
  919. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  920. }
  921. @Override
  922. public Set<Entry<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>>> entrySet() {
  923. return new Set<Entry<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>>>(){
  924. @Override
  925. public int size() {
  926. return size;
  927. }
  928. @Override
  929. public boolean isEmpty() {
  930. return size == 0;
  931. }
  932. @Override
  933. public boolean contains(Object o) {
  934. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  935. }
  936. @Override
  937. public Iterator<Entry<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>>> iterator() {
  938. return new Iterator<Entry<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>>>(){
  939. int current = 0;
  940. @Override
  941. public boolean hasNext() {
  942. return current < size;
  943. }
  944. @Override
  945. public Entry<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>> next() {
  946. if (current < size) {
  947. current++;
  948. try {
  949. final FileNameSortedKey key = new FileNameSortedKey(aStream);
  950. final CsmUID<CsmNamespaceDefinition> value = factory.readUID(aStream);
  951. assert value != null;
  952. return new Entry<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>>(){
  953. @Override
  954. public FileNameSortedKey getKey() {
  955. return key;
  956. }
  957. @Override
  958. public CsmUID<CsmNamespaceDefinition> getValue() {
  959. return value;
  960. }
  961. @Override
  962. public CsmUID<CsmNamespaceDefinition> setValue(CsmUID<CsmNamespaceDefinition> value) {
  963. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  964. }
  965. };
  966. } catch (IOException ex) {
  967. Exceptions.printStackTrace(ex);
  968. }
  969. }
  970. return null;
  971. }
  972. @Override
  973. public void remove() {
  974. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  975. }
  976. };
  977. }
  978. @Override
  979. public Object[] toArray() {
  980. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  981. }
  982. @Override
  983. public <T> T[] toArray(T[] a) {
  984. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  985. }
  986. @Override
  987. public boolean add(Entry<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>> o) {
  988. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  989. }
  990. @Override
  991. public boolean remove(Object o) {
  992. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  993. }
  994. @Override
  995. public boolean containsAll(Collection<?> c) {
  996. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  997. }
  998. @Override
  999. public boolean addAll(Collection<? extends Entry<FileNameSortedKey, CsmUID<CsmNamespaceDefinition>>> c) {
  1000. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  1001. }
  1002. @Override
  1003. public boolean retainAll(Collection<?> c) {
  1004. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  1005. }
  1006. @Override
  1007. public boolean removeAll(Collection<?> c) {
  1008. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  1009. }
  1010. @Override
  1011. public void clear() {
  1012. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  1013. }
  1014. };
  1015. }
  1016. }
  1017. private static final class HelperCharSequencesSortedMap implements SortedMap<CharSequence, Object> {
  1018. private final RepositoryDataInput aStream;
  1019. private final int size;
  1020. private final UIDObjectFactory factory;
  1021. private final APTStringManager manager;
  1022. private HelperCharSequencesSortedMap(UIDObjectFactory factory, RepositoryDataInput aStream, APTStringManager manager) throws IOException {
  1023. size = aStream.readInt();
  1024. this.aStream = aStream;
  1025. this.factory = factory;
  1026. this.manager = manager;
  1027. }
  1028. @Override
  1029. public Comparator<? super CharSequence> comparator() {
  1030. return CharSequences.comparator();
  1031. }
  1032. @Override
  1033. public SortedMap<CharSequence, Object> subMap(CharSequence fromKey, CharSequence toKey) {
  1034. throw new UnsupportedOperationException("Not supported yet."); //NOI18N
  1035. }
  1036. @Override
  1037. public SortedMap<CharSequence, Object> headMap(CharSequence toKey) {