Class VarEvent


  • public class VarEvent
    extends Object
    This class deliberately lacks fields having to do with the Var's value, to encourage (well, to force) listeners to query the Var directly. This helps avoid bugs in situations with nested modification, in which one modification triggers a listener that makes a second modification. In such a case, some listeners can get notified of the modifications out of order.

    If a listener needs to know the new value, it should query the Var directly. If a listener needs to know the old value as well, the listener itself must keep track of the value the Var had the last time that listener was fired. This may be different for different listeners, especially in a situation with nested modification.

    Some helper functions, especially for listeners needing to know the Var's old value, can be found in VarUtils.

    • Field Detail

      • ongoing

        public final boolean ongoing
    • Constructor Detail

      • VarEvent

        public VarEvent​(boolean ongoing)