当前位置: 首页>>代码示例>>Java>>正文


Java ValueMetaInterface.getNumberOfBinaryStringConversions方法代码示例

本文整理汇总了Java中org.pentaho.di.core.row.ValueMetaInterface.getNumberOfBinaryStringConversions方法的典型用法代码示例。如果您正苦于以下问题:Java ValueMetaInterface.getNumberOfBinaryStringConversions方法的具体用法?Java ValueMetaInterface.getNumberOfBinaryStringConversions怎么用?Java ValueMetaInterface.getNumberOfBinaryStringConversions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.core.row.ValueMetaInterface的用法示例。


在下文中一共展示了ValueMetaInterface.getNumberOfBinaryStringConversions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: quickSort

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/** 
 * Sort the entire vector, if it is not empty.
 */
public void quickSort(List<Object[]> elements)
{
	if (log.isDetailed()) logDetailed("Starting quickSort algorithm..."); 
	if (elements.size()>0)
	{ 
           Collections.sort(elements, new Comparator<Object[]>()
               {
                   public int compare(Object[] o1, Object[] o2)
                   {
                       Object[] r1 = (Object[]) o1;
                       Object[] r2 = (Object[]) o2;
                       
                       try
                       {
                           return data.outputRowMeta.compare(r1, r2, data.fieldnrs);
                       }
                       catch(KettleValueException e)
                       {
                           logError("Error comparing rows: "+e.toString());
                           return 0;
                       }
                   }
               }
           );
           long nrConversions = 0L;
           for (ValueMetaInterface valueMeta : data.outputRowMeta.getValueMetaList())
           {
           	nrConversions+=valueMeta.getNumberOfBinaryStringConversions();
           	valueMeta.setNumberOfBinaryStringConversions(0L);
           }
           if(log.isDetailed()) logDetailed("The number of binary string to data type conversions done in this sort block is "+nrConversions);
	}
	if (log.isDetailed()) logDetailed("QuickSort algorithm has finished.");
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:38,代码来源:SortRows.java

示例2: quickSort

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * Sort the entire vector, if it is not empty.
 */
public void quickSort(List<Object[]> elements) throws KettleException {
  if (log.isDetailed())
    logDetailed("Starting quickSort algorithm...");
  if (elements.size() > 0) {
    
    Collections.sort(elements, new Comparator<Object[]>() {
      public int compare(Object[] o1, Object[] o2) {
        Object[] r1 = (Object[]) o1;
        Object[] r2 = (Object[]) o2;

        try {
          return data.outputRowMeta.compare(r1, r2, data.fieldnrs);
        } catch (KettleValueException e) {
          logError("Error comparing rows: " + e.toString());
          return 0;
        }
      }
    });
    
    long nrConversions = 0L;
    for (ValueMetaInterface valueMeta : data.outputRowMeta.getValueMetaList()) {
      nrConversions += valueMeta.getNumberOfBinaryStringConversions();
      valueMeta.setNumberOfBinaryStringConversions(0L);
    }
    if (log.isDetailed())
      logDetailed("The number of binary string to data type conversions done in this sort block is " + nrConversions);
  }
  if (log.isDetailed())
    logDetailed("QuickSort algorithm has finished.");
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:34,代码来源:SortRows.java


注:本文中的org.pentaho.di.core.row.ValueMetaInterface.getNumberOfBinaryStringConversions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。