接口 ValueRef
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
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static class
ValueRef.NullValueRef
A ValueRef for the null value.static class
ValueRef.TypedValueHolderValueRef
A ValueRef holder for a single value, which cannot be set.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 TypedValue
getValue()
Returns the value this ValueRef points to, it should not require expression component re-evaluation.boolean
isWritable()
Indicates whether calling setValue(Object) is supported.void
setValue(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.