public void addLookupEntry(PDPage current, PDPage importPage) { lookups.addLookupEntry(current, importPage); }
public void addLookupEntry(PDPage current, PDPage importPage) { lookups.addLookupEntry(current, importPage); }
@Test public void lookup() { victim.addLookupEntry("this", "that"); victim.addLookupEntry("this1", "that1"); victim.addLookupEntry("this2", "that2"); assertEquals("that2", victim.lookup("this2")); }
@Test public void values() { victim.addLookupEntry("this", "that"); victim.addLookupEntry("this1", "that1"); victim.addLookupEntry("this2", "that2"); assertEquals(3, victim.values().size()); }
@Test public void keys() { victim.addLookupEntry("this", "that"); victim.addLookupEntry("this1", "that1"); victim.addLookupEntry("this", "that2"); assertEquals(2, victim.values().size()); } }
@Test public void first() { victim.addLookupEntry("this", "that"); victim.addLookupEntry("this1", "that1"); victim.addLookupEntry("this2", "that2"); assertEquals("that", victim.first()); }
@Test(expected = NullPointerException.class) public void nullFirst() { victim.addLookupEntry(null, "not null"); }
@Test(expected = NullPointerException.class) public void nullSecond() { victim.addLookupEntry("not null", null); }
public void retain(int page, TaskExecutionContext executionContext) throws TaskExecutionException { try { PDPage existingPage = origin.getPage(page - 1); pagesLookup.addLookupEntry(existingPage, destinationDocument.importPage(existingPage)); LOG.trace("Imported page number {}", page); } catch (PageNotFoundException e) { executionContext.assertTaskIsLenient(e); notifyEvent(executionContext.notifiableTaskMetadata()) .taskWarning(String.format("Page %d was skipped, could not be processed", page), e); } }
private PDAnnotation duplicate(PDAnnotation annotation, LookupTable<PDPage> relevantPages) { PDPage p = annotation.getPage(); PDAnnotation duplicate = PDAnnotation.createAnnotation(annotation.getCOSObject().duplicate()); if (nonNull(p)) { duplicate.setPage(relevantPages.lookup(p)); LOG.trace("Updated annotation page reference with the looked up page"); } annotationsLookup.addLookupEntry(annotation, duplicate); return duplicate; }
private PDAnnotation duplicate(PDAnnotation annotation, LookupTable<PDPage> relevantPages) { PDPage p = annotation.getPage(); PDAnnotation duplicate = PDAnnotation.createAnnotation(annotation.getCOSObject().duplicate()); if (nonNull(p)) { duplicate.setPage(relevantPages.lookup(p)); LOG.trace("Updated annotation page reference with the looked up page"); } annotationsLookup.addLookupEntry(annotation, duplicate); return duplicate; }
public void retain(int page, TaskExecutionContext executionContext) throws TaskExecutionException { try { PDPage existingPage = origin.getPage(page - 1); pagesLookup.addLookupEntry(existingPage, destinationDocument.importPage(existingPage)); LOG.trace("Imported page number {}", page); } catch (PageNotFoundException e) { executionContext.assertTaskIsLenient(e); notifyEvent(executionContext.notifiableTaskMetadata()) .taskWarning(String.format("Page %d was skipped, could not be processed", page), e); } }
for (PDPage current : sourceDocumentHandler.getPages()) { executionContext().assertTaskNotCancelled(); pagesLookup.addLookupEntry(current, destinationDocument.importPage(current)); pageCounter++; if (pageCounter % parameters.getStep() == 0) {
PDPage newPage = destinationDocument.importPage(page); lastPage = newPage; pagesLookup.get(documentHandler).addLookupEntry(page, newPage); rotator.rotate(i + 1, filePage.getRotation()); } catch (PageNotFoundException e) {
PDPage newPage = destinationDocument.importPage(page); lastPage = newPage; pagesLookup.get(documentHandler).addLookupEntry(page, newPage); rotator.rotate(i + 1, filePage.getRotation()); } catch (PageNotFoundException e) {
for (PDPage current : sourceDocumentHandler.getPages()) { executionContext().assertTaskNotCancelled(); pagesLookup.addLookupEntry(current, destinationDocument.importPage(current)); pageCounter++; if (pageCounter % parameters.getStep() == 0) {
@Test public void cleanIsEmpty() { assertTrue(victim.isEmpty()); victim.addLookupEntry("this", "that"); assertFalse(victim.isEmpty()); victim.clear(); assertTrue(victim.isEmpty()); }
pagesLookup.addLookupEntry(page, importedPage);
pagesLookup.addLookupEntry(page, importedPage);