Examples of MatrixColumnJDBC


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

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

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

      DiscreteChar tbChar = defaultChar;

      if (tbChar == null) {
        // it is probably a Standard dataType,
        // need to create characters for each column.

        if (!categoricalData.characterHasName(i) && !categoricalData.hasStateNames(i)) {
          // 1. if there is no character name defined and no state names defined,
          // need to use the defined symbol character
          // which is shared for the entire matrix.
          if (symbolChar == null) {

            tbChar = createCharUseSymbols(categoricalData, i);

            symbolChar = tbChar;

          } else {
            tbChar = symbolChar;

//            if (LOGGER.isDebugEnabled()) {
//              LOGGER.debug(" symbolChar reused for column: " + i); //$NON-NLS-1$
//            }
          }

        } else if (!categoricalData.hasStateNames(i)) {
          // 2. if there is character name defined but still no state names,
          // create a new character but need to use symbols as state names.
          tbChar = createCharUseSymbols(categoricalData, i);

          String charName = null;
          if (categoricalData.characterHasName(i)) {
            charName = categoricalData.getCharacterName(i);
          }
          tbChar.setDescription(charName);

        } else {
          // 3. has stateNames defined,
          // create a new character and set defined state names and symbols.
          tbChar = new DiscreteChar();

          String charName = null;
          if (categoricalData.characterHasName(i)) {
            charName = categoricalData.getCharacterName(i);
          }
          tbChar.setDescription(charName);

          int lastState = categoricalData.maxStateWithName(i);

          for (int j = 0; j <= lastState; j++) {
            String stateName = categoricalData.getStateName(i, j);
            String stateNote = categoricalData.getStateNote(i, j);
            char stateSymbol = categoricalData.getSymbol(j);

            DiscreteCharState tbCharState = new DiscreteCharState();
            tbCharState.setDescription(stateName);
            tbCharState.setSymbol(stateSymbol);

            if (!TreebaseUtil.isEmpty(stateNote)) {
              tbCharState.setNotes(stateNote);
            }

            tbChar.addCharState(tbCharState);
          }
        }

        // ////////////////////////////
        // // Need to create a new char. Add states.
        // if (categoricalData.hasStateNames(i)) {
        //
        // String charName = null;
        // if (categoricalData.characterHasName(i)) {
        // charName = categoricalData.getCharacterName(i);
        // }
        // tbChar = new DiscreteChar();
        // tbChar.setDescription(charName);
        //
        // int lastState = categoricalData.maxStateWithName(i);
        //
        // for (int j = 0; j <= lastState; j++) {
        // String stateName = categoricalData.getStateName(i, j);
        // String stateNote = categoricalData.getStateNote(i, j);
        // char stateSymbol = categoricalData.getSymbol(j);
        //           
        // DiscreteCharState tbCharState = new DiscreteCharState();
        // tbCharState.setDescription(stateName);
        // tbCharState.setSymbol(stateSymbol);
        //           
        // if (!TreebaseUtil.isEmpty(stateNote)) {
        // tbCharState.setNotes(stateNote);
        // }
        //    
        // tbChar.addCharState(tbCharState);
        // }
        // } else {
        // // no state name defined. In this case
        // // 1. if there is no character name defined, need to use the defined symbol
        // character
        // // which is shared for the entire matrix.
        // // 2. if there is character name defined, create a new character but need to
        // // use symbol.
        //         
        // if (symbolChar == null) {
        //
        // tbChar = new DiscreteChar();
        // // do we need the symbol boolean property?
        // //tbChar.setSymbol(true);
        //           
        // int lastSymbol = categoricalData.getMaxSymbolDefined();
        //           
        // for (int j = 0; j <= lastSymbol; j++) {
        // //String stateSymbolStr = categoricalData.getStateSymbol(i, j);
        // String stateNote = categoricalData.getStateNote(i, j);
        // char stateSymbol = categoricalData.getSymbol(j);
        //             
        // DiscreteCharState tbCharState = new DiscreteCharState();
        // //tbCharState.setDescription(stateSymbolStr);
        // tbCharState.setSymbol(stateSymbol);
        //             
        // if (!TreebaseUtil.isEmpty(stateNote)) {
        // tbCharState.setNotes(stateNote);
        // }
        //
        // tbChar.addCharState(tbCharState);
        // }
        //
        // symbolChar = tbChar;
        //
        // if (LOGGER.isDebugEnabled()) {
        // LOGGER.debug(" symbolChar created for column: " + i); //$NON-NLS-1$
        // }
        // } else {
        // tbChar = symbolChar;
        //           
        // if (LOGGER.isDebugEnabled()) {
        // LOGGER.debug(" symbolChar reused for column: " + i); //$NON-NLS-1$
        // }
        // }
        // }
      }

      // aColumn.setCharacter(tbChar);
      // m.addColumn(aColumn);
      aColumnJDBC.setPhyloChar(tbChar);
      columnJDBCs.add(aColumnJDBC);
    }

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

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

    // 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);
//      }
View Full Code Here

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

    int colIndex = 0;
    for ( org.nexml.model.Character xmlCharacter : xmlMatrix.getCharacters() ) {
      String charName = xmlCharacter.getLabel();
      DiscreteChar tbChar = new DiscreteChar();
      tbChar.setDescription(charName);
      MatrixColumnJDBC aColumnJDBC = new MatrixColumnJDBC();
      aColumnJDBC.setPhyloChar(tbChar);     
      columnJDBCs.add(aColumnJDBC);
      int rowIndex = 0;
      for ( OTU xmlOTU : xmlMatrix.getOTUs().getAllOTUs() ) {
        @SuppressWarnings("unused")
        MatrixCell<CharacterState> xmlCell = xmlMatrix.getCell(xmlOTU, xmlCharacter);
View Full Code Here

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

    int colIndex = 0;
    for ( org.nexml.model.Character xmlCharacter : xmlMatrix.getCharacters() ) {
      String charName = xmlCharacter.getLabel();
      ContinuousChar tbChar = new ContinuousChar();
      tbChar.setDescription(charName);
      MatrixColumnJDBC aColumnJDBC = new MatrixColumnJDBC();
      aColumnJDBC.setPhyloChar(tbChar);     
      columnJDBCs.add(aColumnJDBC);
      int rowIndex = 0;
      for ( OTU xmlOTU : xmlMatrix.getOTUs().getAllOTUs() ) {
        MatrixCell<Double> xmlCell = xmlMatrix.getCell(xmlOTU, xmlCharacter);
        ContinuousMatrixElementJDBC element = new ContinuousMatrixElementJDBC();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.