diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2016-11-18 00:03:34 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2016-11-18 00:03:34 +0000 |
commit | fdeff8480b3b57f72a42659c30369b6d7a1a9299 (patch) | |
tree | 72de2bac6eaa535356d6ebde0d4580698b9b9c9c /src/main/java/com/healthmarketscience/jackcess/expr/Value.java | |
parent | 874edea4ed1fcfca3a35c98d0706c320fc65c58b (diff) | |
download | jackcess-fdeff8480b3b57f72a42659c30369b6d7a1a9299.tar.gz jackcess-fdeff8480b3b57f72a42659c30369b6d7a1a9299.zip |
reorg of expression classes
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/exprs@1058 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main/java/com/healthmarketscience/jackcess/expr/Value.java')
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/expr/Value.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/expr/Value.java b/src/main/java/com/healthmarketscience/jackcess/expr/Value.java new file mode 100644 index 0000000..5c1d13f --- /dev/null +++ b/src/main/java/com/healthmarketscience/jackcess/expr/Value.java @@ -0,0 +1,45 @@ +/* +Copyright (c) 2016 James Ahlborn + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package com.healthmarketscience.jackcess.expr; + +/** + * + * @author James Ahlborn + */ +public interface Value +{ + public enum Type + { + NULL, BOOLEAN, STRING, DATE, TIME, DATE_TIME, LONG, DOUBLE, BIG_INT, BIG_DEC; + + public boolean isNumeric() { + return inRange(LONG, BIG_DEC); + } + + public boolean isTemporal() { + return inRange(DATE, DATE_TIME); + } + + private boolean inRange(Type start, Type end) { + return ((start.ordinal() <= ordinal()) && (ordinal() <= end.ordinal())); + } + } + + + public Type getType(); + public Object get(); +} |