public abstract class Entity<E extends Entity> extends Object implements Translet.Parseable<E>
public class Articulation extends Entity <Articulation>
EntityCatalog
into which the
new Entity instance is stored. (So the relation from Entity to
EntityCatalog is "many-to-one").
eu.bandm.tools.muli
package. Therefore the
different constructors may get more than one name, and there
are different retrieve methods for names.
Please note that a default for the language is
defined one level above, namely by EntityCatalog.getDefaultLanguage()
.Modifier and Type | Field and Description |
---|---|
protected EntityCatalog<E> |
catalog
The multi-lingual catalog in which this entitiy is contained.
|
protected MuLi |
documentations
The multi-lingual explanation texts for this entitiy.
|
Constructor and Description |
---|
Entity(EntityCatalog<E> catalog)
Creates a new entity with (possibly) multiple names in multiple languages.
|
Entity(EntityCatalog<E> catalog,
Map<String,String> names)
Creates a new entity with (possibly) multiple names in multiple languages.
|
Entity(EntityCatalog<E> catalog,
MuLi humanNames)
Creates a new entity with (possibly) multiple names in multiple languages.
|
Entity(EntityCatalog<E> catalog,
String lang,
String name)
Creates a new entity with only one name.
|
Modifier and Type | Method and Description |
---|---|
void |
addName(String language,
String name)
Add a further name.
|
void |
dump()
Convenience method, dumping to
System.err . |
void |
dump(PrintStream ps)
Debugging method to display this entity.
|
EntityCatalog<E> |
getCatalog()
The multi-lingual catalog in which this entitiy is contained.
|
String |
getDocumentation() |
String |
getDocumentation(String language) |
MuLi |
getDocumentations()
Returns
MuLi containing documentation text in different languages. |
String |
getName()
Look up the name in the
default language, as specified by
EntityCatalog.getDefaultLanguage() |
String |
getName(String language)
Look up the name in the given language.
|
MuLi |
getNames()
Returns
MuLi containing the names in the different languages. |
Translet.Parser<E> |
getParser()
Gets the default parser for this entity, which accepts the name in the
default language, as specified by
EntityCatalog.getDefaultLanguage() |
Translet.Parser<E> |
getParser(String language)
Gets the default parser for this entity, which accepts the name in the
given language.
|
void |
setDocumentation(String language,
String doc)
Add a documentation text in the given langauge.
|
String |
toString(String... languages)
Get the name according to the given language priority,
as defined in
MuLi.get(String...) . |
protected EntityCatalog<E extends Entity> catalog
protected MuLi documentations
public Entity(EntityCatalog<E> catalog)
EntityCatalog.addEntityNames(Entity,MuLi)
, or sim.
ATTENTION The uniqeness of the names of the different entities in one EntityCatalog (in the different languages or the same language) is not checked.
catalog
- where to enter the new instancepublic Entity(EntityCatalog<E> catalog, Map<String,String> names)
EntityCatalog.addEntityNames(Entity,MuLi)
, or sim.
ATTENTION The uniqeness of the names of the different entities in one EntityCatalog (in the different languages or even in the same language) is curently not checked.
catalog
- where to enter the new instancenames
- mapping from language to namepublic Entity(EntityCatalog<E> catalog, String lang, String name)
EntityCatalog.addEntityNames(Entity,MuLi)
, or sim.
ATTENTION The uniqeness of the names of the different entities in one EntityCatalog (in the different languages or the same language) is not checked.
catalog
- where to enter the new instancelang
- language of the namename
- name of the entitypublic Entity(EntityCatalog<E> catalog, MuLi humanNames)
EntityCatalog.addEntityNames(Entity,MuLi)
, or sim.
ATTENTION The uniqeness of the names of the different entities in one EntityCatalog (in the different languages or the same language) is not checked.
catalog
- where to enter the new instancehumanNames
- mapping from language to namepublic EntityCatalog<E> getCatalog()
public Translet.Parser<E> getParser(String language)
getParser
in interface Translet.Parseable<E extends Entity>
public Translet.Parser<E> getParser()
EntityCatalog.getDefaultLanguage()
getParser
in interface Translet.Parseable<E extends Entity>
public String toString(String... languages)
MuLi.get(String...)
.
If this fails, get built-in Object.toString()
conversion result.public String getName()
EntityCatalog.getDefaultLanguage()
public MuLi getDocumentations()
MuLi
containing documentation text in different languages.public void setDocumentation(String language, String doc)
public String getDocumentation()
public void dump(PrintStream ps)
EntityCatalog.dump(PrintStream)
public void dump()
System.err
.