public interface NamesTranslator extends Cloneable
Modifier and Type | Method and Description |
---|---|
int |
addSource(java.lang.String sourceName) |
void |
clear() |
NamesTranslator |
clone()
Creates a copy of the object.
|
static NamesTranslator |
createBaseTranslator() |
static NamesTranslator |
createDummyTranslator() |
static NamesTranslator |
createTrimTranslator(int maxNameLen) |
java.util.List<java.lang.String> |
getAllTranslations(java.lang.String sourceName) |
java.lang.String |
getSource(int index)
Returns the source name corresponding to the translation indicated
in the "index" parameter.
|
java.lang.String |
getSource(java.lang.String translatedName)
Returns the source name corresponding to the translation indicated
in the "translationName" parameter.
|
java.util.List<java.lang.String> |
getSourceNames()
Return the list of source names.
|
java.lang.String |
getSuggestion(java.lang.String name)
Check if the name passed as a parameter collides with
any existing translation.
|
java.util.List<java.lang.String> |
getTranslatedNames()
Return the list of translated names.
|
java.lang.String[] |
getTranslatedNamesAsArray()
Return the list of translated names as a String array.
|
java.lang.String |
getTranslation(int index)
Returns the translation corresponding to the source name indicated
in the "index" parameter.
|
java.lang.String |
getTranslation(java.lang.String sourceName)
Returns the translation corresponding to the source name indicated
in the "sourceName" parameter.
|
boolean |
hasDuplicateSources() |
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 |
rebuild() |
void |
setSourceNames(java.lang.Iterable<java.lang.String> names)
Assign the list of source names and generate the list of translations from them.
|
void |
setSourceNames(java.lang.Iterable objs,
java.util.function.Function<java.lang.Object,java.lang.String> name_getter)
Assign the list of source names and generate the list of translations from them.
|
void |
setSourceNames(java.lang.String[] names)
Assign the list of source names and generate the list of translations from them.
|
int |
setTranslation(int sourcePosition,
java.lang.String translatedName) |
int |
setTranslation(java.lang.String sourceName,
java.lang.String translatedName)
Assign the translation "translationName" to the name "sourceName".
|
void |
updateSourceNames(java.lang.Iterable<java.lang.String> names) |
void |
updateSourceNames(java.lang.Iterable objs,
java.util.function.Function<java.lang.Object,java.lang.String> name_getter) |
void |
updateSourceNames(java.lang.String[] names) |
cloneQuietly, cloneQuietly
static NamesTranslator createTrimTranslator(int maxNameLen)
static NamesTranslator createBaseTranslator()
static NamesTranslator createDummyTranslator()
void setSourceNames(java.lang.String[] names)
names
- void setSourceNames(java.lang.Iterable<java.lang.String> names)
names
- void setSourceNames(java.lang.Iterable objs, java.util.function.Function<java.lang.Object,java.lang.String> name_getter)
objs
- name_getter
- java.util.List<java.lang.String> getSourceNames()
java.util.List<java.lang.String> getTranslatedNames()
java.lang.String[] getTranslatedNamesAsArray()
java.lang.String getTranslation(java.lang.String sourceName)
sourceName
- java.lang.String getSource(java.lang.String translatedName)
translatedName
- java.lang.String getTranslation(int index)
index
- java.lang.String getSource(int index)
index
- java.lang.String getSuggestion(java.lang.String name)
name
- boolean isValid(java.lang.String name)
name
- int setTranslation(java.lang.String sourceName, java.lang.String translatedName)
sourceName
- translatedName
- int setTranslation(int sourcePosition, java.lang.String translatedName)
void rebuild()
int addSource(java.lang.String sourceName)
NamesTranslator clone() throws java.lang.CloneNotSupportedException
Cloneable
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()}.
void updateSourceNames(java.lang.String[] names)
void updateSourceNames(java.lang.Iterable<java.lang.String> names)
void updateSourceNames(java.lang.Iterable objs, java.util.function.Function<java.lang.Object,java.lang.String> name_getter)
java.util.List<java.lang.String> getAllTranslations(java.lang.String sourceName)
void clear()
boolean hasDuplicateSources()