Search in sources :

Example 1 with Element

use of cbit.vcell.solver.MathOverrides.Element in project vcell by virtualcell.

the class SimulationTable method getSimulationRep.

public SimulationRep getSimulationRep(ResultSet rset, DatabaseSyntax dbSyntax) throws IllegalArgumentException, SQLException, DataAccessException {
    KeyValue scKey = new KeyValue(rset.getBigDecimal(table.id.toString()));
    String name = rset.getString(table.name.toString());
    BigDecimal branchID = rset.getBigDecimal(table.versionBranchID.toString());
    KeyValue ownerRef = new KeyValue(rset.getBigDecimal(table.ownerRef.toString()));
    String ownerName = rset.getString(UserTable.table.userid.toString());
    User owner = new User(ownerName, ownerRef);
    KeyValue mathKey = new KeyValue(rset.getBigDecimal(table.mathRef.toString()));
    String taskDesc = rset.getString(table.taskDescription.toString());
    SolverTaskDescription solverTaskDescription = null;
    try {
        solverTaskDescription = new SolverTaskDescription(new CommentStringTokenizer(taskDesc));
    } catch (DataAccessException e) {
        System.out.println("SimulationTable:getSimulationRep(): failed to parse solver task description, exception=[" + e.getMessage() + "]::\n[[[" + taskDesc + "]]]\n");
    // e.printStackTrace();
    }
    CommentStringTokenizer mathOverridesTokenizer = getMathOverridesTokenizer(rset, dbSyntax);
    List<Element> mathOverrideElements = MathOverrides.parseOverrideElementsFromVCML(mathOverridesTokenizer);
    return new SimulationRep(scKey, branchID, name, owner, mathKey, solverTaskDescription, mathOverrideElements.toArray(new MathOverrides.Element[0]));
}
Also used : KeyValue(org.vcell.util.document.KeyValue) User(org.vcell.util.document.User) Element(cbit.vcell.solver.MathOverrides.Element) CommentStringTokenizer(org.vcell.util.CommentStringTokenizer) SolverTaskDescription(cbit.vcell.solver.SolverTaskDescription) BigDecimal(java.math.BigDecimal) DataAccessException(org.vcell.util.DataAccessException)

Aggregations

Element (cbit.vcell.solver.MathOverrides.Element)1 SolverTaskDescription (cbit.vcell.solver.SolverTaskDescription)1 BigDecimal (java.math.BigDecimal)1 CommentStringTokenizer (org.vcell.util.CommentStringTokenizer)1 DataAccessException (org.vcell.util.DataAccessException)1 KeyValue (org.vcell.util.document.KeyValue)1 User (org.vcell.util.document.User)1