From 89a3a179bddd17e8e19bfb5ed693a59d229ae9a8 Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 9 Jan 2024 17:23:56 +0900 Subject: [PATCH] =?UTF-8?q?index=E5=BB=83=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../processor/impl/DocumentProcessorImpl.java | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java index 1eada540..d6b15343 100644 --- a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java +++ b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java @@ -102,11 +102,10 @@ public class DocumentProcessorImpl implements DocumentProcessor{ XmlMetaPageModel xmlMetaPageModel = new XmlMetaPageModel(); xmlMetaPageModel.setFilename(filename); - xmlMetaPageModel.setIndex(xmlMetaModel.getPages().size() + 1); xmlMetaModel.getPages().add(xmlMetaPageModel); logger.info("addNewPageToLast", "finished"); - logger.info("addNewPageToLast", "filename: " + filename + ", index: " + xmlMetaPageModel.getIndex()); + logger.info("addNewPageToLast", "filename: " + filename); } @Override @@ -118,19 +117,6 @@ public class DocumentProcessorImpl implements DocumentProcessor{ } // TODO-rca: 効率悪いので改善する } - // Internal - // Indexを振り直す - private ArrayList reIndexPages(ArrayList pages) { - logger.debug("reIndexPages", "called"); // TODO-rca: 効率化 - ArrayList newPages = new ArrayList<>(); - for (int i = 0; i < pages.size(); i++) { - XmlMetaPageModel xmlMetaPageModel = pages.get(i); - xmlMetaPageModel.setIndex(i + 1); - newPages.add(xmlMetaPageModel); - } - return newPages; - } - @Override public void addNewPageAfterIndex(Bitmap bitmap, int index) throws Exception { logger.debug("addNewPageAfterIndex", "called"); @@ -140,9 +126,7 @@ public class DocumentProcessorImpl implements DocumentProcessor{ XmlMetaPageModel xmlMetaPageModel = new XmlMetaPageModel(); xmlMetaPageModel.setFilename(filename); - xmlMetaPageModel.setIndex(index + 1); xmlMetaModel.getPages().add(index, xmlMetaPageModel); - xmlMetaModel.setPages(reIndexPages(xmlMetaModel.getPages())); } @Override @@ -154,9 +138,7 @@ public class DocumentProcessorImpl implements DocumentProcessor{ XmlMetaPageModel xmlMetaPageModel = new XmlMetaPageModel(); xmlMetaPageModel.setFilename(filename); - xmlMetaPageModel.setIndex(index); xmlMetaModel.getPages().add(index - 1, xmlMetaPageModel); - xmlMetaModel.setPages(reIndexPages(xmlMetaModel.getPages())); } @Override