public class TrimNamesTranslator extends BaseNamesTranslator
AbstractNamesTranslator.SimpleList, AbstractNamesTranslator.SimpleMap| Modifier and Type | Field and Description |
|---|---|
protected int |
maxNameLen |
DEFAULT_FIELD_NAME, hasTranslations, source2translation, translatedNames, translation2sourcesourceNames| Modifier | Constructor and Description |
|---|---|
|
TrimNamesTranslator() |
protected |
TrimNamesTranslator(int maxNameLen) |
| Modifier and Type | Method and Description |
|---|---|
NamesTranslator |
clone()
Creates a copy of the object.
|
java.lang.String |
getSuggestion(java.lang.String name)
Check if the name passed as a parameter collides with
any existing translation.
|
boolean |
isValid(java.lang.String name)
Returns true if the name passed as a parameter does not collide
with any of the existing translations.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
static void |
registerPersistence() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
int |
setTranslation(java.lang.String sourceName,
java.lang.String translatedName)
Assign the translation "translationName" to the name "sourceName".
|
addSource, build, clear, getAllTranslations, getSource, getTranslatedNames, getTranslation, getTranslation, hasDuplicateSources, rebuild, setTranslation, updateSourceNames, updateSourceNames, updateSourceNamesgetSource, getSourceNames, getTranslatedNamesAsArray, setSourceNames, setSourceNames, setSourceNamesequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateBaseTranslator, createDummyTranslator, createTrimTranslator, getSource, getSourceNames, getTranslatedNamesAsArray, setSourceNames, setSourceNames, setSourceNamescloneQuietly, cloneQuietlypublic TrimNamesTranslator()
protected TrimNamesTranslator(int maxNameLen)
public NamesTranslator clone() throws java.lang.CloneNotSupportedException
Cloneableclone in interface NamesTranslatorclone in class BaseNamesTranslatorjava.lang.CloneNotSupportedException - if the instance of the object cannot
be cloned. As this is extending Cloneable so its sure
it implements it, so this exception may be used for problems on specific
object instances.Object#clone()}.public boolean isValid(java.lang.String name)
NamesTranslatorisValid in interface NamesTranslatorisValid in class BaseNamesTranslatorpublic java.lang.String getSuggestion(java.lang.String name)
NamesTranslatorgetSuggestion in interface NamesTranslatorgetSuggestion in class BaseNamesTranslatorpublic int setTranslation(java.lang.String sourceName,
java.lang.String translatedName)
NamesTranslatorsetTranslation in interface NamesTranslatorsetTranslation in class BaseNamesTranslatorpublic static void registerPersistence()
public void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentsaveToState in class BaseNamesTranslatorPersistenceExceptionpublic void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentloadFromState in class BaseNamesTranslatorPersistenceException