From c14221557bd3e56f74fc875d9eb9a55e94500c04 Mon Sep 17 00:00:00 2001 From: gmantele <gmantele@ari.uni-heidelberg.de> Date: Mon, 11 Sep 2017 10:54:28 +0200 Subject: [PATCH] [ADQL] Allow extension of NumericConstant. This commit resolves a part of the Pull Request #14 --- src/adql/query/operand/NumericConstant.java | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/adql/query/operand/NumericConstant.java b/src/adql/query/operand/NumericConstant.java index edd39b9..04b3d40 100644 --- a/src/adql/query/operand/NumericConstant.java +++ b/src/adql/query/operand/NumericConstant.java @@ -16,7 +16,7 @@ package adql.query.operand; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * - * Copyright 2012-2015 - UDS/Centre de DonnĂ©es astronomiques de Strasbourg (CDS), + * Copyright 2012-2017 - UDS/Centre de DonnĂ©es astronomiques de Strasbourg (CDS), * Astronomisches Rechen Institut (ARI) */ @@ -29,15 +29,15 @@ import adql.query.TextPosition; * A numeric (integer, double, ...) constant. * * @author Grégory Mantelet (CDS;ARI) - * @version 1.4 (06/2015) + * @version 1.4 (09/2017) */ -public final class NumericConstant implements ADQLOperand { +public class NumericConstant implements ADQLOperand { - private String value; + protected String value; /** Position of this operand. * @since 1.4 */ - private TextPosition position = null; + protected TextPosition position = null; /** * The numeric value is saved as a string so that the exact user format can be saved. @@ -94,11 +94,11 @@ public final class NumericConstant implements ADQLOperand { this.value = toCopy.value; } - public final String getValue(){ + public String getValue(){ return value; } - public final double getNumericValue(){ + public double getNumericValue(){ try{ return Double.parseDouble(value); }catch(NumberFormatException nfe){ @@ -111,7 +111,7 @@ public final class NumericConstant implements ADQLOperand { * * @param value The numeric value. */ - public final void setValue(long value){ + public void setValue(long value){ this.value = "" + value; } @@ -120,7 +120,7 @@ public final class NumericConstant implements ADQLOperand { * * @param value The numeric value. */ - public final void setValue(double value){ + public void setValue(double value){ this.value = "" + value; } @@ -132,7 +132,7 @@ public final class NumericConstant implements ADQLOperand { * * @see NumericConstant#setValue(String, boolean) */ - public final void setValue(String value) throws NumberFormatException{ + public void setValue(String value) throws NumberFormatException{ setValue(value, true); } @@ -145,7 +145,7 @@ public final class NumericConstant implements ADQLOperand { * @param checkNumeric <i>true</i> to check whether the given value is numeric, <i>false</i> otherwise. * @throws NumberFormatException If the given value can not be converted in a Double. */ - public final void setValue(String value, boolean checkNumeric) throws NumberFormatException{ + public void setValue(String value, boolean checkNumeric) throws NumberFormatException{ if (checkNumeric) Double.parseDouble(value); -- GitLab