@Deprecated public class PropositionNode extends Object implements BooleanNode
PropositionNode
object is a node in a
LogicalPropositionTree
that represents a
proposition. It can evaluate to true
or
false
if given the context of a PropertiesMap
.
A proposition must be in one of the following forms, where
c and d represent a literal string, a
literal number, or a variable:
==
dtrue
if c and d are
identical; false
otherwise.!=
dfalse
if c and d are
identical; true
otherwise.<
dtrue
if c and d are both a
number and c is less than d or if
c and d are both strings and c
is lexigraphically before d; false
otherwise.<=
d<
d ||
c ==
d.>
dtrue
if c and d are both a
number and c is greater than d or if
c and d are both strings and c
is lexigraphically after d; false
otherwise.>=
d>
d ||
c ==
d.=re
dtrue
if c is a string that
matches the regular expression d; false
otherwise.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 DataNode |
c
Deprecated.
|
private DataNode |
d
Deprecated.
|
static String |
EQUALS_OPERATOR
Deprecated.
|
static String |
EQUALS_REGULAR_EXPRESSION_OPERATOR
Deprecated.
|
static String |
GREATER_THAN_OPERATOR
Deprecated.
|
static String |
GREATER_THAN_OR_EQUAL_OPERATOR
Deprecated.
|
static String |
LESS_THAN_OPERATOR
Deprecated.
|
static String |
LESS_THAN_OR_EQUAL_OPERATOR
Deprecated.
|
static String |
NOT_EQUAL_OPERATOR
Deprecated.
|
private String |
operator
Deprecated.
|
private Pattern |
pattern
Deprecated.
|
Constructor and Description |
---|
PropositionNode()
Deprecated.
|
PropositionNode(DataNode newC,
DataNode newD,
String newOperator)
Deprecated.
|
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 . |
DataNode |
getC()
Deprecated.
|
DataNode |
getD()
Deprecated.
|
String |
getOperator()
Deprecated.
|
void |
setC(DataNode newC)
Deprecated.
|
void |
setD(DataNode newD)
Deprecated.
|
void |
setOperator(String newOperator)
Deprecated.
|
public static final String EQUALS_OPERATOR
public static final String NOT_EQUAL_OPERATOR
public static final String LESS_THAN_OPERATOR
public static final String LESS_THAN_OR_EQUAL_OPERATOR
public static final String GREATER_THAN_OPERATOR
public static final String GREATER_THAN_OR_EQUAL_OPERATOR
public static final String EQUALS_REGULAR_EXPRESSION_OPERATOR
private DataNode c
private DataNode d
private String operator
private Pattern pattern
public PropositionNode()
public PropositionNode(DataNode newC, DataNode newD, String newOperator) throws LogicalPropositionTreeException
LogicalPropositionTreeException
public DataNode getC()
public void setC(DataNode newC)
public DataNode getD()
public void setD(DataNode newD)
public String getOperator()
public void setOperator(String newOperator) throws LogicalPropositionTreeException
LogicalPropositionTreeException
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.