|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfacets.util.Tracer
facets.util.StatefulCore
public class StatefulCore
Basic Stateful
which stamps each state change.
Stamping is useful when
Non-transient
member variables in subclasses must be
Serializable
; transient
members may not be final.
Latency due to serialization can be minimised by defining a
small group of persistent members and recreating transient members during
setState
.
Constructor Summary | |
---|---|
StatefulCore(java.lang.String title)
Unique constructor. |
Method Summary | |
---|---|
Stateful |
copyState()
Implements interface method. |
void |
setState(java.lang.Object src)
Implements interface method. |
void |
setTitle(java.lang.String title)
Sets the text to be returned by title() |
boolean |
stateEquals(Stateful s)
Invalid stub implementation. |
java.lang.Object |
stateStamp()
Implements interface method. |
java.lang.String |
title()
Implements interface method. |
java.lang.String |
toString()
Re-implementation wrapping Debug.info(Object) . |
java.lang.Object |
updateStateStamp()
Implements interface method. |
Methods inherited from class facets.util.Tracer |
---|
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutput, traceOutputWithClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StatefulCore(java.lang.String title)
Also calls updateStateStamp()
.
title
- passed to setTitle(String)
Method Detail |
---|
public Stateful copyState()
Wrapper for Util.deserializedCopy(Serializable)
copyState
in interface Stateful
public void setState(java.lang.Object src)
Does not actually set any state, but does change the value returned
by stateStamp()
: if updating itself by calling updateStateStamp()
,
otherwise by casting src
to a Stateful
and copying its stateStamp()
setState
in interface Stateful
src
- must be non-null and interpretable by the implementation
as state information; it will usually be another instance of the
Stateful
's class.public boolean stateEquals(Stateful s)
stateEquals
in interface Stateful
s
- to comparepublic final java.lang.Object stateStamp()
stateStamp
in interface Stateful
Integer
unique amongst all states of all Stateful
spublic final java.lang.Object updateStateStamp()
Increments the value to be returned by stateStamp()
.
updateStateStamp
in interface Stateful
public final java.lang.String title()
title
in interface Titled
setTitle(String)
public final void setTitle(java.lang.String title)
title()
public java.lang.String toString()
Debug.info(Object)
.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |