本文整理汇总了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);
}