|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.problets.lib.comm.database.DataTranslator
public class DataTranslator
read the structure of the queries from a local file and creates the appropriate queries
Constructor Summary | |
---|---|
DataTranslator(java.lang.String structureFilename)
The constructor opens the file that contains the translation instructions |
Method Summary | |
---|---|
java.util.Vector |
getCommands()
returns a vector containing strings with commands to insert in each table |
static void |
main(java.lang.String[] args)
|
AttributeValue |
parseElement(java.lang.String a_element)
returns an AttributeValue object containing data from the string argument |
DatabaseRecord |
parseVectorFromTutor(java.util.Vector vectorFromTutor)
Put the data from the vector that is send from the tutor to a DatabaseRecord object |
void |
printTable()
a function that prints the commands vector |
static java.util.Vector |
readFromLocalFile(java.lang.String path,
java.lang.String fileName)
This method returns a vector containing the contents of a file included with Jar file. |
java.util.Vector |
returnStructure()
return a vector with the current structure |
java.util.HashMap |
translate(java.util.Vector vectorFromTutor)
Translates the supplied databaseRecord object from the tutor with the translation instructions read from a local file and returns a hash map with all translations |
void |
trimDataInVector()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataTranslator(java.lang.String structureFilename)
structureFilename
- the name of the file that contains the translation instructionsMethod Detail |
---|
public java.util.Vector returnStructure()
public java.util.Vector getCommands()
none
-
public java.util.HashMap translate(java.util.Vector vectorFromTutor)
vectorFromTutor
- the data vector that is supplied by the tutor
public static java.util.Vector readFromLocalFile(java.lang.String path, java.lang.String fileName)
public void trimDataInVector()
public AttributeValue parseElement(java.lang.String a_element)
a_element
- a string to be parsed
public DatabaseRecord parseVectorFromTutor(java.util.Vector vectorFromTutor)
vectorFromTutor
- the vector that is passed from the tutor
public void printTable()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |