@Deprecated public class NumberLiteralNode extends Object implements DataNode
NumberLiteralNode
object is a node in a
LogicalPropositionTree
that represents a literal
number. It can evaluate to a number.
A literal number is string in the form
"-"?[0-9]*"."?[0-9]* that evaluates to a number.Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Modifier and Type | Field and Description |
---|---|
(package private) BigDecimal |
number
Deprecated.
The numerical value of this node.
|
Constructor and Description |
---|
NumberLiteralNode(BigDecimal newNumber)
Deprecated.
Creates a new
NumberLiteralNode with the given
BigDecimal numerical value. |
NumberLiteralNode(double newNumber)
Deprecated.
Creates a new
NumberLiteralNode with the given
double numerical value. |
NumberLiteralNode(long newNumber)
Deprecated.
Creates a new
NumberLiteralNode with the given
long numerical value. |
NumberLiteralNode(String newNumber)
Deprecated.
Creates a new
NumberLiteralNode with thes numerical value
represented by the given string. |
Modifier and Type | Method and Description |
---|---|
BigDecimal |
getNumber(PropertiesMap map)
Deprecated.
Retrieves this node's numerical value.
|
String |
getString(PropertiesMap map)
Deprecated.
Retrieves this node's string value.
|
boolean |
isANumber(PropertiesMap map)
Deprecated.
Determines whether this node can evaluate to a number with the given
context.
|
boolean |
isAString(PropertiesMap map)
Deprecated.
Determines whether this node can evaluate to a string with the given
context.
|
BigDecimal number
public NumberLiteralNode(String newNumber)
NumberLiteralNode
with thes numerical value
represented by the given string.newNumber
- The numerical value of the new node in a string
representation.public NumberLiteralNode(BigDecimal newNumber)
NumberLiteralNode
with the given
BigDecimal
numerical value.newNumber
- The numerical value of the new node represented by a
BigDecimal
object.public NumberLiteralNode(double newNumber)
NumberLiteralNode
with the given
double
numerical value.newNumber
- The numerical value of the new node represented by a
double
.public NumberLiteralNode(long newNumber)
NumberLiteralNode
with the given
long
numerical value.newNumber
- The numerical value of the new node represented by a
long
.public boolean isANumber(PropertiesMap map)
true
always.public boolean isAString(PropertiesMap map)
false
always.public BigDecimal getNumber(PropertiesMap map)
BigDecimal
containing the numerical value of this node.public String getString(PropertiesMap map) throws LogicalPropositionTreeException
getString
in interface DataNode
map
- The context within which we are evaluating the string value.
Does not affect the result of this call since this node has a constant
value.LogicalPropositionTreeException
- Since this node has only a
numerical value.