Package org.cipres.treebase.dao.jdbc

Examples of org.cipres.treebase.dao.jdbc.ContinuousMatrixJDBC


  protected MatrixJDBC createMatrix(CharacterData pMesqMatrix) {

    ContinuousData continuousData = (ContinuousData) pMesqMatrix;
    ContinuousMatrix m = new ContinuousMatrix();
   
    ContinuousMatrixJDBC matrixJDBC = new ContinuousMatrixJDBC(m, continuousData, this);

    int numChars = continuousData.getNumChars();
    int numItems = continuousData.getNumItems();

    mItemDefinitions = new Double2DArray[numItems];
    mItemDefinitionNames = new String[numItems];
   
    Set<ItemDefinition> itemDefs = new HashSet<ItemDefinition>();

    List<MatrixColumnJDBC> columnJDBCs = new ArrayList<MatrixColumnJDBC>();
    List<ItemDefinitionJDBC> itemDefJDBCs = new ArrayList<ItemDefinitionJDBC>();
   
    // add Item definitions if there are any:
    for (int j = 0; j < numItems; j++) {
      Double2DArray anItem = continuousData.getItem(j);

      String itemName = continuousData.getItemName(j);
      mItemDefinitionNames[j] = itemName;
      mItemDefinitions[j] = anItem;
       
      // This can be null, means the default definition 'AVG' is used.
      ItemDefinition definition = getItemDefinition(itemName);
      //ItemDefinitionJDBC itemDefJDBC = new ItemDefinitionJDBC();
      //itemDefJDBC.setColumnIndex(pNewColumnIndex);
      //itemDefJDBC.setItemDefinitionDesc(itemName);
     
      if (definition != null) {
        itemDefs.add(definition);
        getItemDefMap().put(anItem, definition);
      }
    }
   
    if (!itemDefs.isEmpty()) {
      m.setItemDefinitions(itemDefs);
    }

    // add character/column:
    for (int i = 0; i < numChars; i++) {

      //MatrixColumn aColumn = new MatrixColumn();
      MatrixColumnJDBC aColumnJDBC = new MatrixColumnJDBC();
     
      ContinuousChar tbChar = new ContinuousChar();

      String charName = continuousData.getCharacterName(i);
      tbChar.setDescription(charName);

      //aColumn.setCharacter(tbChar);
      aColumnJDBC.setPhyloChar(tbChar);
     
      //Note: Set for itemDefs per column. Disabled for now.
//      if (!itemDefs.isEmpty()) {
//        aColumn.setItemDefinitions(itemDefs);
//      }
      //m.addColumn(aColumn);
      columnJDBCs.add(aColumnJDBC);
    }

    matrixJDBC.setMatrixColumnJDBCs(columnJDBCs);
    return matrixJDBC;
  }
View Full Code Here


    }

    List<ContinuousMatrixElementJDBC> elements = new ArrayList<ContinuousMatrixElementJDBC>();
               
      long[] colIds = pMatrixJDBC.getColIDs();
      ContinuousMatrixJDBC cMatrixJDBC = (ContinuousMatrixJDBC) pMatrixJDBC;
     
      for (int colIndex = 0; colIndex < colIds.length; colIndex++) {
        long colId = colIds[colIndex];
       
        createColJDBCElements(colId, colIndex, cMatrixJDBC, elements);
View Full Code Here

   * @param xmlMatrix
   * @return
   */
  private Matrix fromXmlToTreeBase(org.nexml.model.ContinuousMatrix xmlMatrix) {   
    ContinuousMatrix tbMatrix = new ContinuousMatrix();   
    ContinuousMatrixJDBC matrixJDBC = new ContinuousMatrixJDBC(tbMatrix, xmlMatrix, this);   
    List<MatrixColumnJDBC> columnJDBCs = new ArrayList<MatrixColumnJDBC>();
    long[] colIds = matrixJDBC.getColIDs();
    long[] rowIds = matrixJDBC.getRowIDs();
    List<ContinuousMatrixElementJDBC> elements = new ArrayList<ContinuousMatrixElementJDBC>();
   
    int colIndex = 0;
    for ( org.nexml.model.Character xmlCharacter : xmlMatrix.getCharacters() ) {
      String charName = xmlCharacter.getLabel();
View Full Code Here

TOP

Related Classes of org.cipres.treebase.dao.jdbc.ContinuousMatrixJDBC

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.