org.pentaho.di.core.Const.toDouble()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(201)

本文整理了Java中org.pentaho.di.core.Const.toDouble()方法的一些代码示例,展示了Const.toDouble()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Const.toDouble()方法的具体详情如下:
包路径:org.pentaho.di.core.Const
类名称:Const
方法名:toDouble

Const.toDouble介绍

[英]Convert a String into a double. If the conversion fails, assign a default value.
[中]将字符串转换为双精度字符串。如果转换失败,请指定默认值。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public double getNumber() {
 return Const.toDouble( string, 0.0 );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public void setString( String string ) {
 this.number = Const.toDouble( string, 0.0 );
}

代码示例来源:origin: pentaho/pentaho-kettle

public void modifyText( ModifyEvent e ) {
  Text w = (Text) e.widget;
  rightMargin = Const.toDouble( w.getText(), 0.00 );
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void modifyText( ModifyEvent e ) {
  Text w = (Text) e.widget;
  leftMargin = Const.toDouble( w.getText(), 0.00 );
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void modifyText( ModifyEvent e ) {
  Text w = (Text) e.widget;
  topMargin = Const.toDouble( w.getText(), 0.00 );
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void modifyText( ModifyEvent e ) {
  Text w = (Text) e.widget;
  bottomMargin = Const.toDouble( w.getText(), 0.00 );
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

geoRSSModule = new W3CGeoModuleImpl();
geoRSSModule.setPosition( new Position( Const.toDouble( geopointLat.replace( ',', '.' ), 0 ), Const
 .toDouble( geopointLong.replace( ',', '.' ), 0 ) ) );
entry.getModules().add( geoRSSModule );

代码示例来源:origin: pentaho/pentaho-kettle

public ServerStatus( Node statusNode ) throws KettleException {
 this();
 statusDescription = XMLHandler.getTagValue( statusNode, "statusdesc" );
 memoryFree = Const.toLong( XMLHandler.getTagValue( statusNode, "memory_free" ), -1L );
 memoryTotal = Const.toLong( XMLHandler.getTagValue( statusNode, "memory_total" ), -1L );
 String cpuCoresStr = XMLHandler.getTagValue( statusNode, "cpu_cores" );
 cpuCores = Const.toInt( cpuCoresStr, -1 );
 String cpuProcessTimeStr = XMLHandler.getTagValue( statusNode, "cpu_process_time" );
 cpuProcessTime = Utils.isEmpty( cpuProcessTimeStr ) ? 0L : Long.valueOf( cpuProcessTimeStr );
 uptime = Const.toLong( XMLHandler.getTagValue( statusNode, "uptime" ), -1 );
 threadCount = Const.toInt( XMLHandler.getTagValue( statusNode, "thread_count" ), -1 );
 loadAvg = Const.toDouble( XMLHandler.getTagValue( statusNode, "load_avg" ), -1.0 );
 osName = XMLHandler.getTagValue( statusNode, "os_name" );
 osVersion = XMLHandler.getTagValue( statusNode, "os_version" );
 osArchitecture = XMLHandler.getTagValue( statusNode, "os_arch" );
}

代码示例来源:origin: pentaho/pentaho-kettle

public void cleanupLogRecords( LogTableCoreInterface logTable ) throws KettleDatabaseException {
 double timeout = Const.toDouble( Const.trim( environmentSubstitute( logTable.getTimeoutInDays() ) ), 0.0 );
 if ( timeout < 0.000001 ) {

代码示例来源:origin: pentaho/pentaho-kettle

|| FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
 == FuzzyMatchMeta.OPERATION_TYPE_PAIR_SIMILARITY ) {
if ( Const.toDouble( transMeta.environmentSubstitute( wminValue.getText() ), 0 ) > 1 ) {
 wminValue.setText( String.valueOf( 1 ) );
if ( Const.toDouble( transMeta.environmentSubstitute( wmaxValue.getText() ), 0 ) > 1 ) {
 wmaxValue.setText( String.valueOf( 1 ) );

代码示例来源:origin: pentaho/pentaho-kettle

public SlaveServerStatus( Node statusNode ) throws KettleException {
 this();
 statusDescription = XMLHandler.getTagValue( statusNode, "statusdesc" );
 memoryFree = Const.toLong( XMLHandler.getTagValue( statusNode, "memory_free" ), -1L );
 memoryTotal = Const.toLong( XMLHandler.getTagValue( statusNode, "memory_total" ), -1L );
 String cpuCoresStr = XMLHandler.getTagValue( statusNode, "cpu_cores" );
 cpuCores = Const.toInt( cpuCoresStr, -1 );
 String cpuProcessTimeStr = XMLHandler.getTagValue( statusNode, "cpu_process_time" );
 cpuProcessTime = Utils.isEmpty( cpuProcessTimeStr ) ? 0L : Long.valueOf( cpuProcessTimeStr );
 uptime = Const.toLong( XMLHandler.getTagValue( statusNode, "uptime" ), -1 );
 threadCount = Const.toInt( XMLHandler.getTagValue( statusNode, "thread_count" ), -1 );
 loadAvg = Const.toDouble( XMLHandler.getTagValue( statusNode, "load_avg" ), -1.0 );
 osName = XMLHandler.getTagValue( statusNode, "os_name" );
 osVersion = XMLHandler.getTagValue( statusNode, "os_version" );
 osArchitecture = XMLHandler.getTagValue( statusNode, "os_arch" );
 Node listTransNode = XMLHandler.getSubNode( statusNode, "transstatuslist" );
 Node listJobsNode = XMLHandler.getSubNode( statusNode, "jobstatuslist" );
 int nrTrans = XMLHandler.countNodes( listTransNode, SlaveServerTransStatus.XML_TAG );
 int nrJobs = XMLHandler.countNodes( listJobsNode, SlaveServerJobStatus.XML_TAG );
 for ( int i = 0; i < nrTrans; i++ ) {
  Node transStatusNode = XMLHandler.getSubNodeByNr( listTransNode, SlaveServerTransStatus.XML_TAG, i );
  transStatusList.add( new SlaveServerTransStatus( transStatusNode ) );
 }
 for ( int i = 0; i < nrJobs; i++ ) {
  Node jobStatusNode = XMLHandler.getSubNodeByNr( listJobsNode, SlaveServerJobStatus.XML_TAG, i );
  jobStatusList.add( new SlaveServerJobStatus( jobStatusNode ) );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

case FuzzyMatchMeta.OPERATION_TYPE_JARO_WINKLER:
case FuzzyMatchMeta.OPERATION_TYPE_PAIR_SIMILARITY:
 data.minimalSimilarity = Const.toDouble( environmentSubstitute( meta.getMinimalValue() ), 0 );
 if ( isDetailed() ) {
  logDetailed( BaseMessages.getString( PKG, "FuzzyMatch.Log.MinimalSimilarity", data.minimalSimilarity ) );
 data.maximalSimilarity = Const.toDouble( environmentSubstitute( meta.getMaximalValue() ), 1 );
 if ( isDetailed() ) {
  logDetailed( BaseMessages.getString( PKG, "FuzzyMatch.Log.MaximalSimilarity", data.maximalSimilarity ) );

代码示例来源:origin: pentaho/pentaho-kettle

maxDateField = XMLHandler.getTagValue( infonode, "maxdate", "field" );
String offset = XMLHandler.getTagValue( infonode, "maxdate", "offset" );
maxDateOffset = Const.toDouble( offset, 0.0 );
String mdiff = XMLHandler.getTagValue( infonode, "maxdate", "maxdiff" );
maxDateDifference = Const.toDouble( mdiff, 0.0 );

相关文章