@Deprecated public class LogicalNode extends Object implements BooleanNode
LogicalNode
object is a node in a
LogicalPropositionTree
that represents a logical
statement. It can evaluate to true
or false
if given the context of a PropertiesMap
.
||
bfalse
if a and b both
evaluate to false
; true
otherwise.&&
btrue
if a and b both
evaluate to true
; false
otherwise.!
btrue
if b evaluates to
false
; false
otherwise.->
bfalse
if a evaluates to
true
and b evaluates to false
;
true
otherwise.<-
bfalse
if a evaluates to
false
and b evaluates to true
;
true
otherwise.<>
btrue
if a and b both
evaluate to the same truth value; 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 BooleanNode |
a
Deprecated.
|
static String |
AND_OPERATOR
Deprecated.
|
private BooleanNode |
b
Deprecated.
|
static String |
LEFT_OPERATOR
Deprecated.
|
static String |
NOT_OPERATOR
Deprecated.
|
private String |
operator
Deprecated.
|
static String |
OR_OPERATOR
Deprecated.
|
static String |
RIGHT_OPERATOR
Deprecated.
|
static String |
UNARY_OPERATOR
Deprecated.
|
Constructor and Description |
---|
LogicalNode()
Deprecated.
|
LogicalNode(BooleanNode newA,
BooleanNode newB,
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 . |
BooleanNode |
getA()
Deprecated.
|
BooleanNode |
getB()
Deprecated.
|
String |
getOperator()
Deprecated.
|
void |
setA(BooleanNode newA)
Deprecated.
|
void |
setB(BooleanNode newB)
Deprecated.
|
void |
setOperator(String newOperator)
Deprecated.
|
public static final String OR_OPERATOR
public static final String AND_OPERATOR
public static final String NOT_OPERATOR
public static final String RIGHT_OPERATOR
public static final String LEFT_OPERATOR
public static final String UNARY_OPERATOR
private BooleanNode a
private BooleanNode b
private String operator
public LogicalNode()
public LogicalNode(BooleanNode newA, BooleanNode newB, String newOperator) throws LogicalPropositionTreeException
LogicalPropositionTreeException
public BooleanNode getA()
public void setA(BooleanNode newA)
public BooleanNode getB()
public void setB(BooleanNode newB)
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. This can happen if a or b is
null
, if evaluate()
throws an exception for
a or b, operator
is null
,
or operator
is set to an invalid operator.