/** * Gets the persistent IDs of the documents in this corpus. * * @return a {@link List} of Objects representing the persistent IDs of the documents in this * corpus. */ public List<String> getDocumentClassTypes() { List<String> docsIDs = new ArrayList<String>(); if (docDataList == null) return docsIDs; Iterator<DocumentData> iter = docDataList.iterator(); while (iter.hasNext()) { DocumentData data = iter.next(); docsIDs.add(data.getClassType()); } return docsIDs; }
public int findDocument(Document doc) { boolean found = false; DocumentData docData = null; // first try finding the document in memory int index = documents.indexOf(doc); if (index > -1 && index < docDataList.size()) return index; // else try finding a document with the same name and persistent ID Iterator<DocumentData> iter = docDataList.iterator(); for (index = 0; iter.hasNext(); index++) { docData = iter.next(); if (docData.getDocumentName().equals(doc.getName()) && docData.getPersistentID().equals(doc.getLRPersistenceId()) && docData.getClassType().equals(doc.getClass().getName())) { found = true; break; } } if (found && index < docDataList.size()) return index; else return -1; } // findDocument