Package org.cipres.treebase.dao.jdbc

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


        int[] states = CategoricalState.expand(statesLong);

        if (states.length > 1) {
          // multiple states, create a compound element.
          // The original single element "element" is still used as a place holder.
          CompoundElementJDBC compoundElement = new CompoundElementJDBC();

          addDiscreteStateIds(
            states,
            pColIndex,
            categoricalData,
            rowSymbols,
            stateSymbolToIdMap,
            compoundElement);

          compoundElement.setColIndex(pColIndex);
          compoundElement.setRowIndex(rowIndex);
          pMatrixJDBC.getCompoundElements().add(compoundElement);

        } else { // XXX: Can the number of states be 0?  If so, we need a guard condition here 20090121 MJD
          // single state, use single element:
          //String stateName = categoricalData.getStateName(pColIndex, states[0]);
View Full Code Here


       
        // place holder:
        ContinuousMatrixElementJDBC element = new ContinuousMatrixElementJDBC();
       
        // the compound element to be added later:
        CompoundElementJDBC compoundElement = new CompoundElementJDBC();
       
        //Set<ContinuousMatrixElement> elements = new HashSet<ContinuousMatrixElement>();

        // pre calculate the compound values and cache it in compoundElement.
        StringBuilder compoundValues = new StringBuilder();
        compoundValues.append('(');

        for (int j = 0; j < numItems; j++) {
          Double2DArray anItem = getItemDefinitions()[j];
          double elementValue = anItem.getValue(pColIndex, rowIndex);

          compoundElement.getValues().add(elementValue);
         
          String itemName = getItemDefinitionNames()[j];

          // This can be null, means the default definition 'AVG' is used.
          Long itemDefId = pMatrixJDBC.getItemDefNameToIDMap().get(itemName);
          if (itemDefId == null) {
            itemDefId = -1L;
          }
          compoundElement.getItemDefinitionIDs().add(itemDefId);
         
   
          compoundValues.append(elementValue);
          if (j < numItems - 1) {
            compoundValues.append(' ');
          }
        }

        compoundValues.append(')');
        compoundElement.setCompoundValue(compoundValues.toString());

        compoundElement.setColIndex(pColIndex);
        compoundElement.setRowIndex(rowIndex);
        pMatrixJDBC.getCompoundElements().add(compoundElement);
       
        element.setElementOrder(pColIndex);
        element.setMatrixRowID(rowIds[rowIndex]);
        element.setMatrixColID(pColId);
View Full Code Here

TOP

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

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.