接口 ValueRef

  • 所有已知实现类:
    ValueRef.NullValueRef, ValueRef.TypedValueHolderValueRef

    public interface ValueRef
    Represents a reference to a value. With a reference it is possible to get or set the value. Passing around value references rather than the values themselves can avoid incorrect duplication of operand evaluation. For example in 'list[index++]++' without a value reference for 'list[index++]' it would be necessary to evaluate list[index++] twice (once to get the value, once to determine where the value goes) and that would double increment index.
    从以下版本开始:
    3.2
    作者:
    Andy Clement
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型方法说明
      TypedValuegetValue()
      Returns the value this ValueRef points to, it should not require expression component re-evaluation.
      booleanisWritable()
      Indicates whether calling setValue(Object) is supported.
      voidsetValue​(Object newValue)
      Sets the value this ValueRef points to, it should not require expression component re-evaluation.
    • 方法详细资料

      • getValue

        TypedValue getValue()
        Returns the value this ValueRef points to, it should not require expression component re-evaluation.
        返回:
        the value
      • setValue

        void setValue​(Object newValue)
        Sets the value this ValueRef points to, it should not require expression component re-evaluation.
        参数:
        newValue - the new value
      • isWritable

        boolean isWritable()
        Indicates whether calling setValue(Object) is supported.
        返回:
        true if setValue() is supported for this value reference.