Class KuromojiFile.KuromojiUpdater

java.lang.Object
org.codelibs.fess.dict.kuromoji.KuromojiFile.KuromojiUpdater
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
KuromojiFile

protected class KuromojiFile.KuromojiUpdater extends Object implements Closeable
An updater for Kuromoji files.
  • Field Details

    • isCommit

      protected boolean isCommit
      True if the changes have been committed.
    • newFile

      protected File newFile
      The new file.
    • writer

      protected Writer writer
      The writer for the new file.
    • item

      protected KuromojiItem item
      The item to be added or updated.
  • Constructor Details

    • KuromojiUpdater

      protected KuromojiUpdater(KuromojiItem newItem)
      Constructs a new Kuromoji updater.
      Parameters:
      newItem - The new item to be added or updated.
  • Method Details

    • write

      public KuromojiItem write(KuromojiItem oldItem)
      Writes the old item to the new file.
      Parameters:
      oldItem - The old item.
      Returns:
      The new item if it was updated, otherwise the old item.
    • write

      public void write(String line)
      Writes a line to the new file.
      Parameters:
      line - The line to write.
    • commit

      public KuromojiItem commit()
      Commits the changes.
      Returns:
      The new item if it was committed, otherwise null.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable