|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object facets.util.Tracer facets.core.app.ValueContent
public abstract class ValueContent
Encapsulates common operations on ValueNode
content.
Field Summary | |
---|---|
ValueNode |
working
Content passed to the constructor, working and backup copies. |
Constructor Summary | |
---|---|
ValueContent(java.lang.String title,
ValueNode master,
ValueNode working)
Unique constructor. |
Method Summary | |
---|---|
void |
applyChanges()
Implements abstract method. |
boolean |
hasChanged()
Does the working copy differ from the master? |
SIndexing |
newIndexing(ValueNode values,
java.lang.String title,
java.lang.Object[] indexables,
java.lang.Object indexed)
Creates an indexing related to the specified values. |
SIndexing |
newMultipleIndexing(ValueNode values,
java.lang.String title,
java.lang.String[] keys,
boolean invertValues)
Creates a multiple indexing from flag values. |
SNumeric |
newNumeric(ValueNode values,
java.lang.String key,
NumberPolicy policy)
|
STextual |
newTextual(ValueNode values,
java.lang.String key)
Creates a textual target representing the specified value. |
SToggling |
newToggling(ValueNode values,
java.lang.String key)
Convenience method for normal toggling creation. |
SToggling |
newToggling(ValueNode values,
java.lang.String title,
boolean invertValue)
Creates a toggling target representing the specified value. |
void |
reverseChanges()
Implements abstract method. |
abstract void |
targetValuesUpdated(STarget target,
ValueNode values,
java.lang.String keys)
Called by the couplers of targets created with convenience methods. |
java.lang.String |
title()
Return human-readable identifying text. |
java.lang.String |
toString()
|
protected void |
traceOutput(java.lang.String msg)
Outputs complete trace messages to console or elsewhere. |
Methods inherited from class facets.util.Tracer |
---|
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutputWithClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final ValueNode working
Constructor Detail |
---|
public ValueContent(java.lang.String title, ValueNode master, ValueNode working)
master
- values to be updated with any changesworking
- stored as working
;
must not be master
but must be state equal ie a deep copy; should be
shared with any other active ValueContent
s updating the same masterMethod Detail |
---|
public final boolean hasChanged()
Checks state equality of working
with master passed to constructor.
public final void applyChanges()
Sets the state of master passed to constructor from working
.
public final void reverseChanges()
Sets the state of working
to a backup of
master passed to constructor and calls applyChanges()
.
public abstract void targetValuesUpdated(STarget target, ValueNode values, java.lang.String keys)
target
- created in the calling methodvalues
- as passed to and (usually) updated by the methodkeys
- as passed to the method (maybe concatenated)public final STextual newTextual(ValueNode values, java.lang.String key)
Attaches a coupler which
targetValuesUpdated(STarget,ValueNode,String)
with the textual and the parameters passed
values
- contains the valuekey
- retrieves the valuepublic final SToggling newToggling(ValueNode values, java.lang.String key)
Calls newToggling(ValueNode,String,boolean)
with
invertState
passed false
.
protected void traceOutput(java.lang.String msg)
Tracer
Default prepends helpful classname to message.
traceOutput
in class Tracer
msg
- passed from one of the public
methodspublic final SToggling newToggling(ValueNode values, java.lang.String title, boolean invertValue)
Attaches a coupler which
targetValuesUpdated(STarget,ValueNode,String)
with the toggling and the parameters passed
values
- contains the valuetitle
- for the toggling, as key (up to |) retrieves the valueinvertValue
- should values be exposed as the reverse of their stored state
and vice-versapublic final SIndexing newMultipleIndexing(ValueNode values, java.lang.String title, java.lang.String[] keys, boolean invertValues)
Attaches a coupler which
SIndexing.indices()
targetValuesUpdated(STarget,ValueNode,String)
with the indexing, values and the keys concatenated
values
- contains the flagstitle
- passed to indexingkeys
- become the indexables; the flags they retrieve define the indicespublic final SIndexing newIndexing(ValueNode values, java.lang.String title, java.lang.Object[] indexables, java.lang.Object indexed)
This is purely a convenience method as it adds no functionality beyond constructing the indexing.
values
- passed by the empty coupler to
targetValuesUpdated(STarget,ValueNode,String)
together with
the indexing and title
title
- passed to indexingindexables
- passed to indexingindexed
- passed to indexingpublic final SNumeric newNumeric(ValueNode values, java.lang.String key, NumberPolicy policy)
public final java.lang.String title()
Titled
title
in interface Titled
null
, non-empty string with no structural whitespacepublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |