Code example for StringTokenizer

Methods: nextElement

0
    public void map(LongWritable l, Text text, OutputCollector<Text, DoubleWritable> output, Reporter report) throws IOException
    { 
        String line = text.toString();
 
        if ( JavaUtil.isStringKeyNumSeparatedBySpace(line) )  {
        	StringTokenizer st = new StringTokenizer(line);
        	String k = (String) st.nextElement();
        	Double d = Double.valueOf( (String)st.nextElement());
        	output.collect(new Text(k), new DoubleWritable(d));
        } 
         
    } 
}