Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vollt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sonia Zorba
vollt
Commits
c1422155
Commit
c1422155
authored
7 years ago
by
gmantele
Browse files
Options
Downloads
Patches
Plain Diff
[ADQL] Allow extension of NumericConstant.
This commit resolves a part of the Pull Request #14
parent
e03e5725
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/adql/query/operand/NumericConstant.java
+11
-11
11 additions, 11 deletions
src/adql/query/operand/NumericConstant.java
with
11 additions
and
11 deletions
src/adql/query/operand/NumericConstant.java
+
11
−
11
View file @
c1422155
...
...
@@ -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-201
5
- UDS/Centre de Données astronomiques de Strasbourg (CDS),
* Copyright 2012-201
7
- 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 (0
6
/201
5
)
* @version 1.4 (0
9
/201
7
)
*/
public
final
class
NumericConstant
implements
ADQLOperand
{
public
class
NumericConstant
implements
ADQLOperand
{
pr
ivate
String
value
;
pr
otected
String
value
;
/** Position of this operand.
* @since 1.4 */
pr
ivate
TextPosition
position
=
null
;
pr
otected
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment