@Deprecated public class PropertyNode extends Object implements BooleanNode, DataNode
PropertyNode
object is a node in a
LogicalPropositionTree
that represents a variable.
It can possibly be evaluated to a boolean value, a number or a string if
given the context of a PropertiesMap
.
A variable is a stored property in a PropertiesMap
that evaluates to a boolean, a string or a
number.true
or the value
false
.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 |
---|---|
private String |
propertyName
Deprecated.
The name of the property that this node represents.
|
Constructor and Description |
---|
PropertyNode()
Deprecated.
Creates a new
PropertyNode without setting the name of the
property that this node represents. |
PropertyNode(String newPropertyName)
Deprecated.
Creates a new
PropertyNode that represents the property with
the given name. |
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(PropertiesMap map)
Deprecated.
Returns the truth value of this node with the given context, either
true or false . |
BigDecimal |
getNumber(PropertiesMap map)
Deprecated.
Retrieves this node's numerical value.
|
String |
getPropertyName()
Deprecated.
Retrieves the name of the property that this node represents.
|
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.
|
void |
setPropertyName(String newPropertyName)
Deprecated.
Sets the name of the property that this node represents.
|
private String propertyName
public PropertyNode()
PropertyNode
without setting the name of the
property that this node represents.public PropertyNode(String newPropertyName)
PropertyNode
that represents the property with
the given name.newPropertyName
- The name of the property that new new node
represents.public String getPropertyName()
public void setPropertyName(String newPropertyName)
newPropertyName
- The name of the property that this node represents.public boolean evaluate(PropertiesMap map) throws LogicalPropositionTreeException
true
or false
.evaluate
in interface BooleanNode
map
- The context within which we are evaluating the truth value.
Defines the type and value of all properties in the tree during the
evaluation.true
or false
.LogicalPropositionTreeException
- If there was a problem determining
the truth value. Usually this happens because a property was referenced
as the wrong type or did not exist.public boolean isANumber(PropertiesMap map)
true
if a call to getNumber()
with the same context won't throw an exception; false
otherwise.isANumber
in interface DataNode
map
- The context within which we are evaluating the truth value.
Defines the type and value of all properties in the tree during the
evaluation.true
if a call to getNumber()
with the
same context won't throw an exception; false
otherwise.public boolean isAString(PropertiesMap map)
true
if a call to getString()
with the same context won't throw an exception; false
otherwise.isAString
in interface DataNode
map
- The context within which we are evaluating the truth value.
Defines the type and value of all properties in the tree during the
evaluation.true
if a call to getString()
with the
same context won't throw an exception; false
otherwise.public BigDecimal getNumber(PropertiesMap map) throws LogicalPropositionTreeException
BigDecimal
containing the numerical value of this node with the given context.getNumber
in interface DataNode
map
- The context within which we are evaluating the numerical value.
Defines the type and value of all properties in the tree during the
evaluation.BigDecimal
containing the numerical value of this
node with the given context.LogicalPropositionTreeException
- If there was a problem determining
whether this node represents a number. Usually this happens because a
property was referenced as the wrong type or did not exist.public String getString(PropertiesMap map) throws LogicalPropositionTreeException
String
that is the string value of this node with the given context.getString
in interface DataNode
map
- The context within which we are evaluating the string value.
Defines the type and value of all properties in the tree during the
evaluation.String
that is the string value of this node with
the given context.LogicalPropositionTreeException
- If there was a problem determining
whether this node represents a number. Usually this happens because a
property was referenced as the wrong type or did not exist.