|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.ontopia.utils.CachedStringifier
public class CachedStringifier
INTERNAL: Stringifier that maintains a cache of previously stringified objects. It works with any implementation of StringifierIF.
The cache is first checked to see if a stringified version already exists. Otherwise the object is stringified and the cache is updated.
| Field Summary | |
|---|---|
protected Map<Object,String> |
cache
|
protected StringifierIF |
stringifier
|
| Constructor Summary | |
|---|---|
CachedStringifier(StringifierIF stringifier)
|
|
| Method Summary | |
|---|---|
StringifierIF |
getStringifier()
Gets the stringifier that is to be cached. |
void |
refresh()
Refreshes the cache. |
void |
setStringifier(StringifierIF stringifier)
Sets the stringifier that is to be cached. |
String |
toString(Object object)
Returns a stringified version of the object, i.e. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected StringifierIF stringifier
protected Map<Object,String> cache
| Constructor Detail |
|---|
public CachedStringifier(StringifierIF stringifier)
| Method Detail |
|---|
public StringifierIF getStringifier()
public void setStringifier(StringifierIF stringifier)
public String toString(Object object)
StringifierIF
toString in interface StringifierIFobject - the object that is to be made a string
representation of.
object
argument.public void refresh()
CachedIF
refresh in interface CachedIF
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||