Package edu.wisc.game.parser
Class Expression.NegationExpression
java.lang.Object
edu.wisc.game.parser.Expression.NegationExpression
- All Implemented Interfaces:
Expression
,Expression.ArithmeticExpression
- Enclosing interface:
- Expression
public static class Expression.NegationExpression extends Object implements Expression.ArithmeticExpression
!E evaluates to [1] if E is an empty set, or to [] otherwise
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.wisc.game.parser.Expression
Expression.AdditiveExpression, Expression.ArithmeticExpression, Expression.BracketList, Expression.ColonExpression, Expression.ComparisonExpression, Expression.ExList, Expression.Id, Expression.Mapper, Expression.MapTo<T>, Expression.MultiplicativeExpression, Expression.NegationExpression, Expression.Num, Expression.ParenList, Expression.PropMap, Expression.QualifiedId, Expression.RangeExpression, Expression.SerialExpression, Expression.Star, Expression.VarMap, Expression.VarMap2
-
Field Summary
-
Method Summary
Modifier and Type Method Description HashSet<Integer>
evalSet(HashMap<String,HashSet<Integer>> hh)
Evaluates this expression for the given values of the variables involved.HashSet<Object>
evalSet2(Expression.VarMap2 hh)
HashSet<String>
listAllVars()
Lists all variable names used in this expressionExpression
map(Expression.Mapper mapper)
Applies the mapper to each componentString
toSrc()
String
toString()
-
Method Details
-
toString
-
toSrc
- Specified by:
toSrc
in interfaceExpression
-
listAllVars
Lists all variable names used in this expression- Specified by:
listAllVars
in interfaceExpression.ArithmeticExpression
-
evalSet
Description copied from interface:Expression.ArithmeticExpression
Evaluates this expression for the given values of the variables involved. Can be used when the arguments can have multiple values.- Specified by:
evalSet
in interfaceExpression.ArithmeticExpression
- Parameters:
hh
- The hash map that contains for each variable the possible set of its values.- Returns:
- the set of the possible values of the expression, or an empty set if the expression uses a variable whose value is not in h
-
evalSet2
- Specified by:
evalSet2
in interfaceExpression.ArithmeticExpression
-
map
Applies the mapper to each component- Specified by:
map
in interfaceExpression
- Throws:
RuleParseException
-