예제 #1
0
 public static PDOMFile recreateFile(PDOM pdom, final long record) throws CoreException {
   final Database db = pdom.getDB();
   final int linkageID = db.get3ByteUnsignedInt(record + LINKAGE_ID);
   PDOMLinkage linkage = pdom.getLinkage(linkageID);
   if (linkage == null)
     throw new CoreException(createStatus("Invalid linkage ID in database")); // $NON-NLS-1$
   return new PDOMFile(linkage, record);
 }
예제 #2
0
 public static IIndexFragmentFile[] findFiles(
     PDOM pdom, BTree btree, IIndexFileLocation location, IIndexLocationConverter strategy)
     throws CoreException {
   String internalRepresentation = strategy.toInternalFormat(location);
   if (internalRepresentation != null) {
     Finder finder = new Finder(pdom.getDB(), internalRepresentation, -1, null);
     btree.accept(finder);
     long[] records = finder.getRecords();
     PDOMFile[] result = new PDOMFile[records.length];
     for (int i = 0; i < result.length; i++) {
       result[i] = recreateFile(pdom, records[i]);
     }
     return result;
   }
   return IIndexFragmentFile.EMPTY_ARRAY;
 }