|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.baseprogramming.lang.Translation
public class Translation
(c)wordreference.com translation. It Contains a Note, an original term and up to ten translation entries for that term (as of 10/14/2011, (c)wordreference.com provides up to four)
The following is an example of 2 translations in the PrincipalTranslations Category
"PrincipalTranslations" : { "0" :{ "OriginalTerm" : { "term" : "translation", "POS" : "n", "sense" : "document produced", "usage" : ""}, "FirstTranslation" : {"term" : "traduzione", "POS" : "nf", "sense" : "documento prodotto"}, "Note" : ""}, "1" :{ "OriginalTerm" : { "term" : "translation", "POS" : "n", "sense" : "act of translating", "usage" : ""}, "FirstTranslation" : {"term" : "traduzione", "POS" : "nf", "sense" : "azione di tradurre"}, "Note" : ""}},
When parsed, this block would result in a list (java.util.List) of two Translation Elements. Each Translation element would have the original term (a DictionaryTerm), and one translation Entry (also a DictionaryTerm).
Constructor Summary | |
---|---|
Translation()
Default constructor |
Method Summary | |
---|---|
void |
addTranslation(java.lang.String label,
DictionaryTerm term)
Add a translation entry for this term |
static Translation |
createInstance(com.google.gson.JsonObject json,
int index)
Create a translation instance for this JSON objecct |
int |
getCount()
Get count of translation Entries |
DictionaryTerm |
getEntry(java.lang.String name)
Get a translation entry (term) by name (e.g. |
java.util.Set<java.lang.String> |
getEntryNames()
Get all Translation Entry names |
DictionaryTerm |
getFirstTranslation()
Get the first translation |
DictionaryTerm |
getFourthTranslation()
Get the fourth translation |
int |
getIndex()
Get Index |
java.lang.String |
getNote()
Get translation note |
DictionaryTerm |
getOriginalTerm()
get original term |
DictionaryTerm |
getSecondTranslation()
Get the second translation |
DictionaryTerm |
getThirdTranslation()
Get the third translation |
void |
setIndex(int index)
Set index |
void |
setNote(java.lang.String note)
Set Translation note |
void |
setOriginalTerm(DictionaryTerm term)
Set the oridinal term |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Translation()
Method Detail |
---|
public int getCount()
public java.util.Set<java.lang.String> getEntryNames()
public void setNote(java.lang.String note)
note
- public java.lang.String getNote()
public int getIndex()
public void setIndex(int index)
index
- public DictionaryTerm getOriginalTerm()
public void setOriginalTerm(DictionaryTerm term)
term
- public DictionaryTerm getEntry(java.lang.String name) throws java.lang.IllegalArgumentException
name
-
java.lang.IllegalArgumentException
public DictionaryTerm getFirstTranslation()
public DictionaryTerm getSecondTranslation()
public DictionaryTerm getThirdTranslation()
public DictionaryTerm getFourthTranslation()
public void addTranslation(java.lang.String label, DictionaryTerm term)
label
- term
- public java.lang.String toString()
toString
in class java.lang.Object
public static Translation createInstance(com.google.gson.JsonObject json, int index) throws java.io.IOException
json
-
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |