本文整理匯總了Java中org.supercsv.cellprocessor.ParseChar類的典型用法代碼示例。如果您正苦於以下問題:Java ParseChar類的具體用法?Java ParseChar怎麽用?Java ParseChar使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ParseChar類屬於org.supercsv.cellprocessor包,在下文中一共展示了ParseChar類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initialise
import org.supercsv.cellprocessor.ParseChar; //導入依賴的package包/類
public void initialise(String[] properties, CellProcessor[] processors)
{
for (int i = 0; i < getFields().size(); i++) {
FIELD_TYPE type = getFields().get(i).type;
properties[i] = getFields().get(i).name;
if (type == FIELD_TYPE.DOUBLE) {
processors[i] = new Optional(new ParseDouble());
} else if (type == FIELD_TYPE.INTEGER) {
processors[i] = new Optional(new ParseInt());
} else if (type == FIELD_TYPE.FLOAT) {
processors[i] = new Optional(new ParseDouble());
} else if (type == FIELD_TYPE.LONG) {
processors[i] = new Optional(new ParseLong());
} else if (type == FIELD_TYPE.SHORT) {
processors[i] = new Optional(new ParseInt());
} else if (type == FIELD_TYPE.STRING) {
processors[i] = new Optional();
} else if (type == FIELD_TYPE.CHARACTER) {
processors[i] = new Optional(new ParseChar());
} else if (type == FIELD_TYPE.BOOLEAN) {
processors[i] = new Optional(new ParseChar());
} else if (type == FIELD_TYPE.DATE) {
processors[i] = new Optional(new ParseDate("dd/MM/yyyy"));
}
}
}
示例2: addParseChar
import org.supercsv.cellprocessor.ParseChar; //導入依賴的package包/類
/**
* Get cellprocessor to parse String as Character.
*
* @param cellProcessor
* next processor in the chain.
* @return CellProcessor
*/
private static CellProcessor addParseChar(CellProcessor cellProcessor)
{
if (cellProcessor == null) {
return new ParseChar();
}
return new ParseChar((DoubleCellProcessor)cellProcessor);
}