Package edu.wisc.game.parser
Class Expression.ComparisonExpression
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<Expression.ArithmeticExpression>
edu.wisc.game.parser.Expression.SerialExpression
edu.wisc.game.parser.Expression.ComparisonExpression
- All Implemented Interfaces:
Expression
,Expression.ArithmeticExpression
,Serializable
,Cloneable
,Iterable<Expression.ArithmeticExpression>
,Collection<Expression.ArithmeticExpression>
,List<Expression.ArithmeticExpression>
,RandomAccess
- Enclosing interface:
- Expression
public static class Expression.ComparisonExpression extends Expression.SerialExpression
Has exactly two operands, and the operator is '=='
- See Also:
- Serialized Form
-
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)
Expression
map(Expression.Mapper mapper)
Applies the mapper to each componentMethods inherited from class edu.wisc.game.parser.Expression.SerialExpression
listAllVars, toSrc, toString
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Method Details
-
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
- Overrides:
evalSet
in classExpression.SerialExpression
- 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
- Overrides:
evalSet2
in classExpression.SerialExpression
-
map
Applies the mapper to each component- Throws:
RuleParseException
-