Package edu.wisc.game.parser

## Class Expression.Id

- java.lang.Object
- - edu.wisc.game.parser.Expression.Id

- All Implemented Interfaces:
    `Expression`, `Expression.ArithmeticExpression`
  Direct Known Subclasses:
    `Expression.QualifiedId`
  Enclosing interface:
    Expression

      public static class Expression.Id
      extends Object
      implements Expression.ArithmeticExpression

  A variable. In GS 2.0. a STRING is treated as a variable name as well, in order to deal with quoted shape names such as "au/kangaroo".

- - ### 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

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `String` | `sVal` |

    - ### Fields inherited from interface edu.wisc.game.parser.Expression

      `STAR`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Id​(String s)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `HashSet<Integer>` | `evalSet​(HashMap<String,​HashSet<Integer>> h)` | Evaluates this expression for the given values of the variables involved.
    `HashSet<Object>` | `evalSet2​(Expression.VarMap2 h)` |
    `HashSet<String>` | `listAllVars()` |
    `Expression` | `map​(Expression.Mapper mapper)` |
    `String` | `toSrc()` |
    `String` | `toString()` | Returns bare string (never quotes), so that it can be correctly used in RuleSer.PropertyCondition

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### sVal

          public final String sVal

  - ### Constructor Detail

    - #### Id

          public Id​(String s)
             throws RuleParseException

      Parameters:
        `s` - Must be a proper ID, not a quoted string
      Throws:
        `RuleParseException`

  - ### Method Detail

    - #### evalSet

          public HashSet<Integer> evalSet​(HashMap<String,​HashSet<Integer>> h)

      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 interface `Expression.ArithmeticExpression`
      Parameters:
        `h` - 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

          public HashSet<Object> evalSet2​(Expression.VarMap2 h)

      Specified by:
        `evalSet2` in interface `Expression.ArithmeticExpression`

    - #### toString

          public String toString()

      Returns bare string (never quotes), so that it can be correctly used in RuleSer.PropertyCondition
      Overrides:
        `toString` in class `Object`

    - #### toSrc

          public String toSrc()

      Specified by:
        `toSrc` in interface `Expression`

    - #### listAllVars

          public HashSet<String> listAllVars()

      Specified by:
        `listAllVars` in interface `Expression.ArithmeticExpression`

    - #### map

          public Expression map​(Expression.Mapper mapper)
                         throws RuleParseException

      Specified by:
        `map` in interface `Expression`
      Throws:
        `RuleParseException`