|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.mdl.WModel
at.spardat.xma.mdl.simple.SimpleWM
Implements ISimpleWM.
| Field Summary | |
protected byte |
type_
One of the type codes in enterprise.util.Types. |
protected java.lang.String |
value_
A string encoded value of a particular type. |
| Fields inherited from class at.spardat.xma.mdl.WModel |
S_NULL |
| Constructor Summary | |
SimpleWM(short id,
byte type,
Page pm)
Constructs a SimpleWM. |
|
| Method Summary | |
boolean |
changed()
Yields true if this WidgetModel has changed since the last server side event (or creation). |
void |
clear()
Sets this TextModel to the empty string. |
void |
commit()
This method clears the change history. |
void |
describe(DNode n)
describe puts all relevant information about this into the provided node. |
void |
equalsCS(WModel mServer,
int syncPoint)
Compares this widget model (which must be a client side one) with the server buddy mServer and returns true if they are correct with respect to syncPoint. |
int |
estimateMemory()
Estimates the number of bytes this object consumes in memory. |
void |
externalize(XmaOutput xo,
boolean forceFull)
Externalizing either saves the actual state or deltas (changes) in a provided XMAObjectOutput. |
java.lang.String |
getEncodedValue()
Returns the String encoded value of this. |
byte |
getType()
Returns the type constant. |
boolean |
handle(ModelChangeEvent event)
All events that might change a WidgetModel are executed via this method. |
boolean |
hasValue()
Returns true if this model holds a value. |
void |
internalize(XmaInput in)
Updates the state of this with information of the given XMAObjectInput. |
boolean |
isTrue()
Returns true if getType() equals T_BOOLEAN and the stored value equals TRUE. |
void |
randomlyChange()
Makes random changes to this |
void |
rollback()
This method restores this Widget Model to its state immediately after the last server side event (or creation). |
void |
set(java.math.BigDecimal value)
Sets the value from the provided BigDecimal. |
void |
set(boolean value)
If getType() equals T_BOOLEAN, this method sets a boolean value, otherwise it does nothing. |
void |
set(java.lang.Boolean val)
Sets the value from a Boolean. |
void |
set(java.lang.Byte val)
Sets the value from a Byte. |
void |
set(java.util.Date value)
Sets this from a provided java.util.Date. |
void |
set(double value)
Sets the value from a double. |
void |
set(java.lang.Double val)
Sets the value from a Double. |
void |
set(double value,
int precision)
Sets the value from a double. |
void |
set(java.lang.Float val)
If the value is null, this is cleared. |
void |
set(int value)
Sets this from an int. |
void |
set(java.lang.Integer val)
Sets the value from an Integer. |
void |
set(java.lang.Long val)
If the value is null, this is cleared. |
void |
set(java.lang.Short val)
Sets the value from a Short. |
void |
set(java.lang.String value)
Sets the value of this model from a string. |
protected void |
setInternal(java.lang.String value)
This method requires that a legal internal representation has been constructed and manages the state in value_ and savedValue_. |
protected boolean |
settersShouldBeSloppy(Page pm)
Determines if setters should ignore type violations. |
java.math.BigDecimal |
toBigDecimal()
If the type of this is T_BCD, the numeric value is returned as a BigDecimal. |
byte |
toByte()
Returns the value of this as byte. |
java.lang.Byte |
toBYTE()
Returns the value of this as Byte or null if ! |
java.util.Date |
toDate()
Returns a newly constructed java.util.Date object representing the value of this. |
double |
toDouble()
Extracts a double from this. |
java.lang.Double |
toDOUBLE()
Returns the value of this as Double or null if ! |
float |
toFloat()
Extracts a float from this. |
java.lang.Float |
toFLOAT()
Returns the value of this as Float or null if ! |
int |
toInt()
Returns the value of this as int if the type of this is T_BCD. |
java.lang.Integer |
toINTEGER()
Returns the value of this as Integer or null if ! |
long |
toLong()
Returns the value of this as long. |
java.lang.Long |
toLONG()
Returns the value of this as Long or null if ! |
short |
toShort()
Returns the value of this as short. |
java.lang.Short |
toSHORT()
Returns the value of this as Short or null if ! |
java.lang.String |
toString()
Returns a String representing the value of this. |
java.lang.String |
toString(at.spardat.enterprise.fmt.IFmt formatter)
Maps this to string representation using a IFmt object. |
| Methods inherited from class at.spardat.xma.mdl.WModel |
cleanUpAfterServerEvent, getId |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected byte type_
protected java.lang.String value_
| Constructor Detail |
public SimpleWM(short id,
byte type,
Page pm)
id - a numeric id which identifies the WidgetModel within its Page.type - a type constant.pm - the Page this model belongs to| Method Detail |
protected boolean settersShouldBeSloppy(Page pm)
public void clear()
clear in interface ISimpleWMclear in class WModelpublic boolean hasValue()
hasValue in interface IAtomicpublic byte getType()
getType in interface IAtomicTypes.public java.lang.String toString()
IAtomic
T_BOOLEAN "J" or "N"
T_STRING the string itself
T_BCD -12000.32
T_DATE yyyyMMdd
example: 20001231, the last day in the year 2000
T_TIMESTAMP yyyyMMdd HH:mm:ss.SSS z
example: 20001231 23:59:59.999 CET denoting the last millisecond in the year 2000, central european time.
T_DOM key of the domain value
The empty string is returned if this does not store a value.
toString in interface IAtomictoString in class WModelIAtomic.toString()public java.lang.String toString(at.spardat.enterprise.fmt.IFmt formatter)
toString in interface IAtomicformatter - the IFmt formatter. May be null.
public void set(java.lang.String value)
set in interface ISimpleWMvalue - the string to setpublic double toDouble()
toDouble in interface IAtomicpublic float toFloat()
IAtomic
toFloat in interface IAtomicIAtomic.toFloat()
public void set(double value,
int precision)
set in interface ISimpleWMvalue - the value to setprecision - the number of places after the comma used when converting
the double to a string.public void set(double value)
set in interface ISimpleWMvalue - the value to setpublic void set(java.math.BigDecimal value)
ISimpleWM
set in interface ISimpleWMISimpleWM.set(java.math.BigDecimal)public java.math.BigDecimal toBigDecimal()
IAtomic
toBigDecimal in interface IAtomicIAtomic.toBigDecimal()public int toInt()
toInt in interface IAtomicIAtomic.toInt()public long toLong()
IAtomic
toLong in interface IAtomicIAtomic.toLong()public byte toByte()
IAtomic
toByte in interface IAtomicIAtomic.toByte()public short toShort()
IAtomic
toShort in interface IAtomicIAtomic.toShort()public java.lang.Byte toBYTE()
IAtomic
toBYTE in interface IAtomicIAtomic.toByte()public java.lang.Short toSHORT()
IAtomic
toSHORT in interface IAtomicIAtomic.toSHORT()public java.lang.Integer toINTEGER()
IAtomic
toINTEGER in interface IAtomicIAtomic.toINTEGER()public java.lang.Long toLONG()
IAtomic
toLONG in interface IAtomicIAtomic.toLONG()public java.lang.Float toFLOAT()
IAtomic
toFLOAT in interface IAtomicIAtomic.toFLOAT()public java.lang.Double toDOUBLE()
IAtomic
toDOUBLE in interface IAtomicIAtomic.toDOUBLE()public void set(java.lang.Boolean val)
ISimpleWM
set in interface ISimpleWMval - the value to setISimpleWM.set(java.lang.Boolean)public void set(java.lang.Byte val)
ISimpleWMIf the value is null, this is cleared.
set in interface ISimpleWMISimpleWM.set(java.lang.Byte)public void set(java.lang.Short val)
ISimpleWMIf the value is null, this is cleared.
set in interface ISimpleWMISimpleWM.set(java.lang.Short)public void set(java.lang.Integer val)
ISimpleWMIf the value is null, this is cleared.
set in interface ISimpleWMISimpleWM.set(java.lang.Integer)public void set(java.lang.Long val)
ISimpleWM
set in interface ISimpleWMISimpleWM.set(java.lang.Long)public void set(java.lang.Float val)
ISimpleWM
set in interface ISimpleWMISimpleWM.set(java.lang.Float)public void set(java.lang.Double val)
ISimpleWMIf the value is null, this is cleared.
set in interface ISimpleWMISimpleWM.set(java.lang.Double)public void set(int value)
set in interface ISimpleWMvalue - the provided integer to set.public java.util.Date toDate()
toDate in interface IAtomicpublic void set(java.util.Date value)
set in interface ISimpleWMvalue - the value to setpublic boolean isTrue()
isTrue in interface IAtomicpublic void set(boolean value)
set in interface ISimpleWMvalue - the boolean value to setpublic boolean changed()
WModel
changed in interface Transactionalchanged in class WModelWModel.changed()public void commit()
WModel
commit in interface Transactionalcommit in class WModelWModel.commit()public boolean handle(ModelChangeEvent event)
WModel
handle in class WModelevent - the event carrying the information of a change.
WModel.handle(ModelChangeEvent)public void rollback()
WModel
rollback in interface Transactionalrollback in class WModelWModel.rollback()
public void externalize(XmaOutput xo,
boolean forceFull)
throws java.io.IOException
SynchronizationIf forceFull is false, the object implementing this interface must also implement Transactional. If the object implementing this is able to track changes, these are the changes since the last syncpoint.
externalize in interface Synchronizationxo - the serialization destinationforceFull - if true, the complete state is written
and deltas are ignored.
java.io.IOException - on serialization errorsSynchronization.externalize(at.spardat.xma.serializer.XmaOutput, boolean)
public void internalize(XmaInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
SynchronizationThis method is not allowed to throw Exceptions because that would leave models in an inconsistent state. Thrown exceptions are considered to be programming errors. Internalize must not throw technical exceptions which indicate system or ressource failures. That implies that the person implementing internalize is not allowed to access ressources outside the JVM, either directly or via calls to other methods. Examples of ressource access which must not be triggered are calls to communication of file system services.
internalize in interface Synchronizationin - the XMAObjectInput. If a XMAObjectInputChangeListener is
set in the object in, it will be notified after applying
changes read from in.
java.lang.ClassNotFoundException - on serialization errors
java.io.IOException - on serialization errorsSynchronization.internalize(at.spardat.xma.serializer.XmaInput)protected void setInternal(java.lang.String value)
value - the new value to setpublic void describe(DNode n)
Descriptive
describe in interface Descriptivedescribe in class WModelDescriptive.describe(at.spardat.xma.mdl.util.DNode)public void randomlyChange()
randomlyChange in class WModel
public void equalsCS(WModel mServer,
int syncPoint)
WModelThis method is for debugging purpose and assumes that client and server models are running within the same VM. It tests if the models the programmer views after a synchronization operation are consistent.
This method requires that this is a client side model.
This method does not throw an exception if models are the same in terms of their contained model data. If it is allowed that models differ (for example some one way tables), this method must take this fact into account. If the models differ, this indicates a programming error and a RuntimeException is thrown.
equalsCS in class WModelmServer - the server side model partner for this.syncPoint - 0 if the point in time is after a client to server
sychnronization, 1 if the point is after a server to
client synchronization.WModel.equalsCS(at.spardat.xma.mdl.WModel, int)public int estimateMemory()
estimateMemory in class WModelpublic java.lang.String getEncodedValue()
IAtomic
getEncodedValue in interface IAtomicIAtomic.getEncodedValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||