public class TrimNamesTranslator extends BaseNamesTranslator
AbstractNamesTranslator.SimpleList, AbstractNamesTranslator.SimpleMap
Modifier and Type | Field and Description |
---|---|
protected int |
maxNameLen |
DEFAULT_FIELD_NAME, hasTranslations, source2translation, translatedNames, translation2source
sourceNames
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, updateSourceNames
getSource, getSourceNames, getTranslatedNamesAsArray, setSourceNames, setSourceNames, setSourceNames
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createBaseTranslator, createDummyTranslator, createTrimTranslator, getSource, getSourceNames, getTranslatedNamesAsArray, setSourceNames, setSourceNames, setSourceNames
cloneQuietly, cloneQuietly
public TrimNamesTranslator()
protected TrimNamesTranslator(int maxNameLen)
public NamesTranslator clone() throws java.lang.CloneNotSupportedException
Cloneable
clone
in interface NamesTranslator
clone
in class BaseNamesTranslator
java.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)
NamesTranslator
isValid
in interface NamesTranslator
isValid
in class BaseNamesTranslator
public java.lang.String getSuggestion(java.lang.String name)
NamesTranslator
getSuggestion
in interface NamesTranslator
getSuggestion
in class BaseNamesTranslator
public int setTranslation(java.lang.String sourceName, java.lang.String translatedName)
NamesTranslator
setTranslation
in interface NamesTranslator
setTranslation
in class BaseNamesTranslator
public static void registerPersistence()
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
saveToState
in class BaseNamesTranslator
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
loadFromState
in class BaseNamesTranslator
PersistenceException