Package org.codelibs.fess.dict.synonym
Class SynonymItem
java.lang.Object
org.codelibs.fess.dict.DictionaryItem
org.codelibs.fess.dict.synonym.SynonymItem
Represents an item in a synonym dictionary.
This class stores a set of input words and their corresponding output synonyms.
It also tracks updated values for the item.
-
Field Summary
Fields inherited from class org.codelibs.fess.dict.DictionaryItem
id -
Constructor Summary
ConstructorsConstructorDescriptionSynonymItem(long id, String[] inputs, String[] outputs) Constructs a new synonym item. -
Method Summary
Modifier and TypeMethodDescriptionbooleanString[]Gets the original input words.Gets the input words as a newline-separated string.String[]Gets the new input words.String[]Gets the new output synonyms.String[]Gets the original output synonyms.Gets the output synonyms as a newline-separated string.inthashCode()booleanChecks if the item has been marked for deletion.booleanChecks if the item has been updated.voidsetNewInputs(String[] newInputs) Sets the new input words.voidsetNewOutputs(String[] newOutputs) Sets the new output synonyms.Converts the item to a string representation for writing to a file.toString()Methods inherited from class org.codelibs.fess.dict.DictionaryItem
getId
-
Constructor Details
-
SynonymItem
Constructs a new synonym item.- Parameters:
id- The unique identifier of the item.inputs- The input words.outputs- The output synonyms.
-
-
Method Details
-
getNewInputs
Gets the new input words. Returns a defensive copy to prevent external modification.- Returns:
- The new input words (defensive copy).
-
setNewInputs
Sets the new input words.- Parameters:
newInputs- The new input words.
-
getNewOutputs
Gets the new output synonyms. Returns a defensive copy to prevent external modification.- Returns:
- The new output synonyms (defensive copy).
-
setNewOutputs
Sets the new output synonyms.- Parameters:
newOutputs- The new output synonyms.
-
getInputs
Gets the original input words. Returns a defensive copy to prevent external modification.- Returns:
- The original input words (defensive copy).
-
getInputsValue
Gets the input words as a newline-separated string.- Returns:
- The input words as a string.
-
getOutputs
Gets the original output synonyms. Returns a defensive copy to prevent external modification.- Returns:
- The original output synonyms (defensive copy).
-
getOutputsValue
Gets the output synonyms as a newline-separated string.- Returns:
- The output synonyms as a string.
-
isUpdated
public boolean isUpdated()Checks if the item has been updated.- Returns:
- true if the item has been updated, false otherwise.
-
isDeleted
public boolean isDeleted()Checks if the item has been marked for deletion.- Returns:
- true if the item is marked for deletion, false otherwise.
-
hashCode
public int hashCode() -
equals
-
toString
-
toLineString
Converts the item to a string representation for writing to a file.- Returns:
- A string in the format "input1,input2=>output1,output2".
-