|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Handles the vocable administration with a Database.
Method Summary | |
boolean |
addLanguage(User user,
java.lang.String languagename)
Adds a language to the database. |
boolean |
addUnit(User user,
java.lang.String unitname)
Adds a unit to the database. |
boolean |
addVocable(Vocable vocableSet,
User user)
Adds a vocable object in the database with the owner given by the userId of the user. |
boolean |
checkVocable(Vocable vocable,
int modus)
Checks if the vocable is in the database. |
boolean |
delLanguage(User user,
int languageId)
Deletes a language from the database. |
boolean |
delLanguage(User user,
java.lang.String languagename)
Deletes a language from the database. |
boolean |
delUnit(User user,
int unitId)
Deletes a unit specified by unitId from the database. |
boolean |
delUnit(User user,
java.lang.String unitname)
Deletes a unit from the database. |
boolean |
delVocable(Vocable vocable,
User user)
Deletes a record of the database selected by the vocId of the vocable-object. |
boolean |
editVocable(Vocable vocableSet,
boolean status,
User user)
Edits the state of a record in the database selected by the vocId of the vocable object. |
boolean |
editVocable(Vocable vocableSet,
User user)
Edits a record of the database selected by the vocId of the vocable object. |
java.util.Vector |
getAllLanguages()
Returns a vector of all languages defined in the database. |
java.util.Vector |
getAllUnitNames()
Gets all unitnames specified in the database. |
int |
getLanguageIdByLanguagename(java.lang.String languagename)
Returns the id of the language from the database. |
java.util.Vector |
getResultSet(User user,
int lang1,
int lang2)
Returns a vector of vocable objects from the database, where userId and languages, given by the languageId, equals with the database. |
java.util.Vector |
getResultSet(User user,
int lang1,
int lang2,
java.lang.String date)
Returns a vector of vocable objects from the database, where userId, languages given by the languageId equals with the database and where the date of the vocable is younger than the given date. |
java.util.Vector |
getResultSet(User user,
java.lang.String langName1,
java.lang.String langName2)
Returns a vector of vocable objects from the database, where userId and languages, given by the language, equals with the database. |
java.util.Vector |
getResultSet(User user,
java.lang.String langName1,
java.lang.String langName2,
java.lang.String date)
Returns a vector of vocable objects from the database, where userId, languages given by the language equals with the database and where the date of the vocable is younger than the given date. |
int |
getUnitIdByUnitName(java.lang.String unitName)
Gets the UnitId by looking for the unitname in the Database. |
Vocable |
getVocable(int vocId)
Returns the vocable object specified by the vocId. |
Vocable |
getVocable(User user,
int langId1,
int langId2,
int modus,
java.lang.String date,
int unitId)
Returns a vocable object from a user out of the database. |
Vocable |
getVocable(User user,
int langId1,
int langId2,
int modus,
java.lang.String date,
java.lang.String unit)
Returns a vocable object from a user out of the database. |
Vocable |
getVocable(User user,
java.lang.String lang1,
java.lang.String lang2,
int modus,
java.lang.String date,
int unitId)
Returns a vocable object from a user out of the database. |
Vocable |
getVocableFromResultSetByDateRandomly(java.util.Vector resultSet)
Returns a vocable object from a vector of vocable object, choosen randomly by an algorithmen using the date of the vocable object. |
Vocable |
getVocableFromResultSetByStateRandomly(java.util.Vector resultSet)
Returns a vocable object from a vector of vocable object, choosen randomly by an algorithmen using the state of the vocable object. |
Vocable |
getVocableFromResultSetRandomly(java.util.Vector resultSet)
Returns a vocable object from a vector of vocable object, choosen randomly. |
void |
init()
Initializes the database. |
Method Detail |
public void init() throws java.lang.Exception
java.lang.Exception
- if there is no connect to the database, or the precompile of SQL statements fails.public Vocable getVocable(User user, int langId1, int langId2, int modus, java.lang.String date, int unitId) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- The owner of the vocables.langId1
- The source language.langId2
- The destination language to translate to.modus
- The mode that determines how to get the vocabluaries.date
- The oldest date to get the vocabluaries from.unitid
- The unit id to get the vocabluaries from.public Vocable getVocable(User user, java.lang.String lang1, java.lang.String lang2, int modus, java.lang.String date, int unitId) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- The owner of the vocables.lang1
- The source language.lang2
- The destination language to translate to.modus
- The mode that determines how to get the vocabluaries.date
- The oldest date to get the vocabluaries from.unitid
- The unit id to get the vocabluaries from.InvalidArgumentException
- if java.sql.SQLException
- if data couldn't be retrieved from the database.public Vocable getVocable(User user, int langId1, int langId2, int modus, java.lang.String date, java.lang.String unit) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- The owner of the vocables.langId1
- The source language.langId2
- The destination language to translate to.modus
- The mode that determines how to get the vocabluaries.date
- The oldest date to get the vocabluaries from.unit
- The unit to get the vocabluaries from.InvalidArgumentException
- if java.sql.SQLException
- if data couldn't be retrieved from the database.public Vocable getVocable(int vocId) throws java.sql.SQLException
vocId
- The primary key of the vocable table in the database.user
- The owner of the vocable.java.sql.SQLException
- if data couldn't be retrieved from the database.public Vocable getVocableFromResultSetRandomly(java.util.Vector resultSet) throws java.sql.SQLException
resultSet
- A vector of vocable objects.java.sql.SQLException
- if data couldn't be retrieved from the database.public Vocable getVocableFromResultSetByStateRandomly(java.util.Vector resultSet) throws java.sql.SQLException
resultSet
- A vector of vocable objects.java.sql.SQLException
- if data couldn't be retrieved from the database.public Vocable getVocableFromResultSetByDateRandomly(java.util.Vector resultSet) throws java.sql.SQLException
resultSet
- A set of vocable objects.java.sql.SQLException
- if data couldn't be retrieved from the database.public java.util.Vector getResultSet(User user, int lang1, int lang2) throws java.sql.SQLException
user
- A User-Object.lang1
- LanguageId of Vocable1.lang2
- LanguageId of Vocable2.java.sql.SQLException
- if data couldn't be retrieved from the database.public java.util.Vector getResultSet(User user, java.lang.String langName1, java.lang.String langName2) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- A user object.langName1
- Languagename of vocable1.langName2
- Languagename of vocable2.InvalidArgumentException
- if the at least one of the languages does not exists.java.sql.SQLException
- if data couldn't be retrieved from the database.public java.util.Vector getResultSet(User user, int lang1, int lang2, java.lang.String date) throws java.sql.SQLException
user
- A user object.lang1
- LanguageId of vocable1.lang2
- LanguageId of vocable2.date
- The date of the oldest vocable that will be returned.java.sql.SQLException
- if data couldn't be retrieved from the database.public java.util.Vector getResultSet(User user, java.lang.String langName1, java.lang.String langName2, java.lang.String date) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- A user object.langName1
- Languagename of vocable1.langName2
- Languagename of vocable2.date
- The date of the oldest vocable that will be returned.InvalidArgumentException
- if the at least one of the languages does not exists.java.sql.SQLException
- if data couldn't be retrieved from the database.public boolean checkVocable(Vocable vocable, int modus) throws java.lang.IllegalArgumentException, java.sql.SQLException
vocable
- The Vocable-Object to check.modus
- The current modus.InvalidArgumentException
- if the modus was invalid.java.sql.SQLException
- if data couldn't be retrieved from the database.public boolean addUnit(User user, java.lang.String unitname) throws java.sql.SQLException
user
- To determine if user is superuser.unitname
- The name of the unit to add.java.sql.SQLException
- if data couldn't be addedd to the database.public boolean delUnit(User user, java.lang.String unitname) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- To determine if user is superuser.unitname
- The name of the unit to delete.InvalidArgumentException
- if the unitname does not exists.java.sql.SQLException
- if data couldn't be deleted from the database.public boolean delUnit(User user, int unitId) throws java.sql.SQLException
user
- To determine if user is superuser.unitId
- The id of the unit to delete.java.sql.SQLException
- if data couldn't be deleted from the database.public int getUnitIdByUnitName(java.lang.String unitName) throws java.lang.IllegalArgumentException, java.sql.SQLException
unitName
- The name of the choosen unit.InvalidArgumentException
- if the unitname does not exists.java.sql.SQLException
- if data couldn't be retrieved from the database.public java.util.Vector getAllUnitNames() throws java.sql.SQLException
java.sql.SQLException
- if data couldn't be retrieved from the database.public boolean addLanguage(User user, java.lang.String languagename) throws java.sql.SQLException
user
- To determine if user is superuser.languagename
- The name of the language to add.java.sql.SQLException
- if data couldn't be added to the database.public boolean delLanguage(User user, java.lang.String languagename) throws java.lang.IllegalArgumentException, java.sql.SQLException
user
- To determine if user is superuser.languagename
- The name of the language to delete.InvalidArgumentException
- if the language does not exists.java.sql.SQLException
- if data couldn't be deleted from the database.public boolean delLanguage(User user, int languageId) throws java.sql.SQLException
user
- To determine if user is superuser.languageId
- The id of the language to delete.InvalidArgumentException
- if the language does not exists.java.sql.SQLException
- if data couldn't be deleted from the database.public java.util.Vector getAllLanguages() throws java.sql.SQLException
java.sql.SQLException
- if data couldn't be retrieved from the database.public int getLanguageIdByLanguagename(java.lang.String languagename) throws java.lang.IllegalArgumentException, java.sql.SQLException
languagename
- The language.InvalidArgumentException
- if the language does not exists.java.sql.SQLException
- if data couldn't be retrieved from the database.public boolean editVocable(Vocable vocableSet, User user) throws java.sql.SQLException
vocableSet
- This vocable object will be updated in the database.user
- The owner of the vocable.java.sql.SQLException
- if data couldn't be updated in the database.public boolean addVocable(Vocable vocableSet, User user) throws java.sql.SQLException
vocableSet
- This vocable object will be added in the database.user
- The owner of the vocableSet.java.sql.SQLException
- if data couldn't be added to the database.public boolean delVocable(Vocable vocable, User user) throws java.sql.SQLException
vocable
- This vocable object will be deleted in the database.java.sql.SQLException
- if data couldn't be deleted in the database.public boolean editVocable(Vocable vocableSet, boolean status, User user) throws java.sql.SQLException
vocableSet
- The state of this vocable object will be updated in the database.status
- If the answer was correct then status must be true else false.user
- The owner of the vocable.java.sql.SQLException
- if data couldn't be updated in the database.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |