CSVObjects Framework

net.sf.anupam.csv.formatters
Class FirstWordFormatter

java.lang.Object
  extended by net.sf.anupam.csv.formatters.FirstWordFormatter
All Implemented Interfaces:
CSVFieldFormatter

final class FirstWordFormatter
extends Object
implements CSVFieldFormatter

A formatter that returns the first word of the specified CSV value. This is useful in situations such as extracting the first name.

Since:
1.5
Version:
$Revision: 1.3 $
Author:
Anupam Sengupta
See Also:
LastWordFormatter
CSV Formatter Mapping:
CSV Formatter Name: "firstWord"

Constructor Summary
FirstWordFormatter()
          Constructor for FirstWordFormatter.
 
Method Summary
 String format(String value)
          Formats the value and returns the first word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirstWordFormatter

public FirstWordFormatter()
Constructor for FirstWordFormatter.

Method Detail

format

public String format(String value)
Formats the value and returns the first word.

Specified by:
format in interface CSVFieldFormatter
Parameters:
value - the value to be transformed
Returns:
the first word from the input value
See Also:
CSVFieldFormatter.format(String)

SourceForge.net Logo

© Anupam Sengupta 2005