public static interface UIDefaults.LazyValue
getXXX(key)
方法。懒惰的值是有用的默认值是昂贵的构造或很少检索。第一次
LazyValue
检索其“真正的价值”是通过调用
LazyValue.createValue()
与真实值计算是用来在
UIDefaults
表代替
LazyValue
。随后查找相同的键返回真值。这是一个
LazyValue
构建一个
Border
例:
对象borderlazyvalue =新uidefaults。lazyvalue() {公共对象创造价值(uidefaults表){新borderfactory createloweredbevelborder()返回;}};uidefaultstable。把(“myborder”,borderlazyvalue);
Modifier and Type | Method and Description |
---|---|
Object |
createValue(UIDefaults table)
创造实际价值的
UIDefaults 表检索。
|
Object createValue(UIDefaults table)
UIDefaults
表检索。当从表中检索实现此接口的对象时,该方法用于创建真正的值,然后将其存储在表中并返回到调用方法。
table
-
UIDefaults
表
Object
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.