diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2018-12-20 21:20:24 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2018-12-20 21:20:24 +0000 |
commit | 9c638f35bf36cca19a58c5f0a3267af63b164069 (patch) | |
tree | cc1d6306d985a2b56721ad02869beafb345b8568 /src/main/java/com/healthmarketscience/jackcess/impl/expr | |
parent | a92bc3439fb02222c8afd65718674461b41b8de3 (diff) | |
download | jackcess-9c638f35bf36cca19a58c5f0a3267af63b164069.tar.gz jackcess-9c638f35bf36cca19a58c5f0a3267af63b164069.zip |
overrides everywhere
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jdk8@1246 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main/java/com/healthmarketscience/jackcess/impl/expr')
11 files changed, 62 insertions, 0 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseDelayedValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseDelayedValue.java index 1e99e64..8c2b9de 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseDelayedValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseDelayedValue.java @@ -40,42 +40,52 @@ public abstract class BaseDelayedValue implements Value return _val; } + @Override public boolean isNull() { return(getType() == Type.NULL); } + @Override public Value.Type getType() { return getDelegate().getType(); } + @Override public Object get() { return getDelegate().get(); } + @Override public boolean getAsBoolean(LocaleContext ctx) { return getDelegate().getAsBoolean(ctx); } + @Override public String getAsString(LocaleContext ctx) { return getDelegate().getAsString(ctx); } + @Override public LocalDateTime getAsLocalDateTime(LocaleContext ctx) { return getDelegate().getAsLocalDateTime(ctx); } + @Override public Value getAsDateTimeValue(LocaleContext ctx) { return getDelegate().getAsDateTimeValue(ctx); } + @Override public Integer getAsLongInt(LocaleContext ctx) { return getDelegate().getAsLongInt(ctx); } + @Override public Double getAsDouble(LocaleContext ctx) { return getDelegate().getAsDouble(ctx); } + @Override public BigDecimal getAsBigDecimal(LocaleContext ctx) { return getDelegate().getAsBigDecimal(ctx); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseValue.java index 35e6ccf..e2a7453 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseValue.java @@ -29,34 +29,42 @@ import com.healthmarketscience.jackcess.expr.Value; */ public abstract class BaseValue implements Value { + @Override public boolean isNull() { return(getType() == Type.NULL); } + @Override public boolean getAsBoolean(LocaleContext ctx) { throw invalidConversion(Type.LONG); } + @Override public String getAsString(LocaleContext ctx) { throw invalidConversion(Type.STRING); } + @Override public LocalDateTime getAsLocalDateTime(LocaleContext ctx) { return (LocalDateTime)getAsDateTimeValue(ctx).get(); } + @Override public Value getAsDateTimeValue(LocaleContext ctx) { throw invalidConversion(Type.DATE_TIME); } + @Override public Integer getAsLongInt(LocaleContext ctx) { throw invalidConversion(Type.LONG); } + @Override public Double getAsDouble(LocaleContext ctx) { throw invalidConversion(Type.DOUBLE); } + @Override public BigDecimal getAsBigDecimal(LocaleContext ctx) { throw invalidConversion(Type.BIG_DEC); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BigDecimalValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BigDecimalValue.java index 0e78f90..56bc911 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BigDecimalValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BigDecimalValue.java @@ -33,10 +33,12 @@ public class BigDecimalValue extends BaseNumericValue _val = val; } + @Override public Type getType() { return Type.BIG_DEC; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DateTimeValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DateTimeValue.java index f9d1e7b..9b58941 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DateTimeValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DateTimeValue.java @@ -40,10 +40,12 @@ public class DateTimeValue extends BaseValue _val = val; } + @Override public Type getType() { return _type; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctions.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctions.java index 763d1d5..5a871e4 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctions.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctions.java @@ -53,6 +53,7 @@ public class DefaultFunctions } public static final FunctionLookup LOOKUP = new FunctionLookup() { + @Override public Function getFunction(String name) { return FUNCS.get(DatabaseImpl.toLookupName(name)); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DoubleValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DoubleValue.java index d37c90b..e00e24a 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DoubleValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DoubleValue.java @@ -33,10 +33,12 @@ public class DoubleValue extends BaseNumericValue _val = val; } + @Override public Type getType() { return Type.DOUBLE; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java index 92da3f6..d9cf5b9 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java @@ -1685,22 +1685,27 @@ public class Expressionator return areConstant(_left, _right); } + @Override public OpType getOp() { return _op; } + @Override public Expr getLeft() { return _left; } + @Override public void setLeft(Expr left) { _left = left; } + @Override public Expr getRight() { return _right; } + @Override public void setRight(Expr right) { _right = right; } @@ -1748,14 +1753,17 @@ public class Expressionator return _expr.isConstant(); } + @Override public OpType getOp() { return _op; } + @Override public Expr getRight() { return _expr; } + @Override public void setRight(Expr right) { _expr = right; } @@ -1854,14 +1862,17 @@ public class Expressionator return _expr.isConstant(); } + @Override public OpType getOp() { return _op; } + @Override public Expr getLeft() { return _expr; } + @Override public void setLeft(Expr left) { _expr = left; } @@ -1986,10 +1997,12 @@ public class Expressionator return _expr.isConstant() && areConstant(_startRangeExpr, _endRangeExpr); } + @Override public Expr getRight() { return _endRangeExpr; } + @Override public void setRight(Expr right) { _endRangeExpr = right; } @@ -2032,22 +2045,27 @@ public class Expressionator _expr = expr; } + @Override public String toDebugString(LocaleContext ctx) { return _expr.toDebugString(ctx); } + @Override public String toRawString() { return _rawExprStr; } + @Override public String toCleanString(LocaleContext ctx) { return _expr.toCleanString(ctx); } + @Override public boolean isConstant() { return _expr.isConstant(); } + @Override public void collectIdentifiers(Collection<Identifier> identifiers) { _expr.collectIdentifiers(identifiers); } @@ -2112,6 +2130,7 @@ public class Expressionator _resultType = resultType; } + @Override public Object eval(EvalContext ctx) { return evalValue(_resultType, ctx); } @@ -2127,6 +2146,7 @@ public class Expressionator super(rawExprStr, expr); } + @Override public Object eval(EvalContext ctx) { return evalCondition(ctx); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/FunctionSupport.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/FunctionSupport.java index aa978e2..b9cbb1a 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/FunctionSupport.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/FunctionSupport.java @@ -47,10 +47,12 @@ public class FunctionSupport _maxParams = maxParams; } + @Override public String getName() { return _name; } + @Override public boolean isPure() { // most functions are probably pure, so make this the default return true; @@ -94,6 +96,7 @@ public class FunctionSupport return false; } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -112,6 +115,7 @@ public class FunctionSupport super(name, 1, 1); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -130,6 +134,7 @@ public class FunctionSupport super(name, 1, 1); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -152,6 +157,7 @@ public class FunctionSupport super(name, 2, 2); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -170,6 +176,7 @@ public class FunctionSupport super(name, 3, 3); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -193,6 +200,7 @@ public class FunctionSupport super(name, minParams, maxParams); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -215,14 +223,17 @@ public class FunctionSupport _name = _delegate.getName() + NON_VAR_SUFFIX; } + @Override public String getName() { return _name; } + @Override public boolean isPure() { return _delegate.isPure(); } + @Override public Value eval(EvalContext ctx, Value... params) { Value result = _delegate.eval(ctx, params); if(result.isNull()) { diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/LongValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/LongValue.java index 30025ad..27aa715 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/LongValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/LongValue.java @@ -33,10 +33,12 @@ public class LongValue extends BaseNumericValue _val = val; } + @Override public Type getType() { return Type.LONG; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/StringValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/StringValue.java index ca74f35..ff799be 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/StringValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/StringValue.java @@ -40,10 +40,12 @@ public class StringValue extends BaseValue _val = val; } + @Override public Type getType() { return Type.STRING; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/ValueSupport.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/ValueSupport.java index 805cc32..e7be9bc 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/ValueSupport.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/ValueSupport.java @@ -39,9 +39,11 @@ public class ValueSupport @Override public boolean isNull() { return true; } + @Override public Type getType() { return Type.NULL; } + @Override public Object get() { return null; } |