Package org.codelibs.fess.dict.protwords
Class ProtwordsFile.ProtwordsUpdater
java.lang.Object
org.codelibs.fess.dict.protwords.ProtwordsFile.ProtwordsUpdater
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
ProtwordsFile
Updater class for processing protwords items during dictionary updates.
This class handles the writing and committing of changes to the dictionary file.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtwordsUpdater(ProtwordsItem newItem) Constructor for ProtwordsUpdater. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()commit()Commits the current item to the temporary file.voidWrites a string line to the temporary file.write(ProtwordsItem oldItem) Writes a protwords item to the temporary file.
-
Field Details
-
isCommit
protected boolean isCommitFlag indicating if the update should be committed -
newFile
Temporary file for storing updates -
writer
Writer for writing to the temporary file -
item
The item being updated
-
-
Constructor Details
-
ProtwordsUpdater
Constructor for ProtwordsUpdater.- Parameters:
newItem- the item to be updated
-
-
Method Details
-
write
Writes a protwords item to the temporary file.- Parameters:
oldItem- the item to write- Returns:
- the written item or null if deleted
-
write
Writes a string line to the temporary file.- Parameters:
line- the line to write
-
commit
Commits the current item to the temporary file.- Returns:
- the committed item or null if no item to commit
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-