本文整理了Java中cascading.tuple.TupleEntry.setInteger()
方法的一些代码示例,展示了TupleEntry.setInteger()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TupleEntry.setInteger()
方法的具体详情如下:
包路径:cascading.tuple.TupleEntry
类名称:TupleEntry
方法名:setInteger
[英]Method setInteger sets the value in the given field or position.
[中]方法setInteger设置给定字段或位置中的值。
代码示例来源:origin: cwensel/cascading
private void makeCalendarFields( TupleEntry output, Date date )
{
Calendar calendar = getCalendar();
calendar.setTime( date );
for( int i = 0; i < calendarFields.length; i++ )
output.setInteger( i, calendar.get( calendarFields[ i ] ) );
}
代码示例来源:origin: cwensel/cascading
@Override
public boolean source( FlowProcess<? extends Properties> flowProcess, SourceCall<LineNumberReader, InputStream> sourceCall ) throws IOException
{
// first line is 0, this matches offset being zero, so when throwing out the first line for comments
int lineNumber = sourceCall.getContext().getLineNumber();
String line = sourceCall.getContext().readLine();
if( line == null )
return false;
TupleEntry incomingEntry = sourceCall.getIncomingEntry();
if( getSourceFields().size() == 1 )
{
incomingEntry.setObject( 0, line );
}
else
{
incomingEntry.setInteger( 0, lineNumber );
incomingEntry.setString( 1, line );
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!