|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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 java.util.Map<java.lang.Object,java.lang.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. |
java.lang.String |
toString(java.lang.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 java.util.Map<java.lang.Object,java.lang.String> cache
Constructor Detail |
---|
public CachedStringifier(StringifierIF stringifier)
Method Detail |
---|
public StringifierIF getStringifier()
public void setStringifier(StringifierIF stringifier)
public java.lang.String toString(java.lang.Object object)
StringifierIF
toString
in interface StringifierIF
object
- 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 |