Browse Source

minor cleanups

git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1282 f203690c-595d-4dc9-a70b-905162fa7fd2
tags/jackcess-3.0.0
James Ahlborn 5 years ago
parent
commit
92caa33ac2

+ 1
- 1
src/main/java/com/healthmarketscience/jackcess/impl/expr/DefaultDateFunctions.java View File



private static TextStyle getTextStyle(EvalContext ctx, Value[] params, private static TextStyle getTextStyle(EvalContext ctx, Value[] params,
int idx) { int idx) {
boolean abbreviate = getOptionalBooleanParam(ctx, params, 1);
boolean abbreviate = getOptionalBooleanParam(ctx, params, idx);
return (abbreviate ? TextStyle.SHORT : TextStyle.FULL); return (abbreviate ? TextStyle.SHORT : TextStyle.FULL);
} }



+ 6
- 6
src/main/java/com/healthmarketscience/jackcess/impl/expr/FormatUtil.java View File



switch(curFormatType) { switch(curFormatType) {
case FCT_GENERAL: case FCT_GENERAL:
return parseCustomGeneralFormat(buf, args);
return parseCustomGeneralFormat(buf);
case FCT_DATE: case FCT_DATE:
return parseCustomDateFormat(buf, args); return parseCustomDateFormat(buf, args);
case FCT_NUMBER: case FCT_NUMBER:
return parseCustomNumberFormat(buf, args); return parseCustomNumberFormat(buf, args);
case FCT_TEXT: case FCT_TEXT:
return parseCustomTextFormat(buf, args);
return parseCustomTextFormat(buf);
default: default:
throw new EvalException("Invalid format type " + curFormatType); throw new EvalException("Invalid format type " + curFormatType);
} }
return FCT_GENERAL; return FCT_GENERAL;
} }


private static Fmt parseCustomGeneralFormat(ExprBuf buf, Args args) {
private static Fmt parseCustomGeneralFormat(ExprBuf buf) {


// a "general" format is actually a "yes/no" format which functions almost // a "general" format is actually a "yes/no" format which functions almost
// exactly like a number format (without any number format specific chars) // exactly like a number format (without any number format specific chars)
} }
break; break;
case FCT_DATE: case FCT_DATE:
parseCustomDateFormatPattern(c, buf, dfbs, fmtState, args);
parseCustomDateFormatPattern(c, buf, dfbs, fmtState);
break; break;
default: default:
dfbs.add(buildLiteralCharDFB(c)); dfbs.add(buildLiteralCharDFB(c));


private static void parseCustomDateFormatPattern( private static void parseCustomDateFormatPattern(
char c, ExprBuf buf, List<DateFormatBuilder> dfbs, char c, ExprBuf buf, List<DateFormatBuilder> dfbs,
boolean[] fmtState, Args args) {
boolean[] fmtState) {


if((c == DT_LIT_COLON_CHAR) || (c == DT_LIT_SLASH_CHAR)) { if((c == DT_LIT_COLON_CHAR) || (c == DT_LIT_SLASH_CHAR)) {
// date/time literal char, nothing more to do // date/time literal char, nothing more to do
return new DecimalBDFormat(df); return new DecimalBDFormat(df);
} }


private static Fmt parseCustomTextFormat(ExprBuf buf, Args args) {
private static Fmt parseCustomTextFormat(ExprBuf buf) {


Fmt fmt = null; Fmt fmt = null;



Loading…
Cancel
Save