at.spardat.xma.mdl.simple
Interface ISimpleWM

All Superinterfaces:
IAtomic
All Known Subinterfaces:
ISimpleWMClient
All Known Implementing Classes:
SimpleWM, SimpleWMClient

public interface ISimpleWM
extends IAtomic

A SimpleWM models the data that might be contained in a Text or Label, Check Box, Radio Button or Toggle Button on a UI. The content of this is typed, although that is not reflected via a class hierarchy. The type is stored in a type field an may be queries using the method getType(). getType() returns a type constant of the class Types.

The atomic value encapsulated by this is String encoded, see class Atom.


Method Summary
 void clear()
          Sets this TextModel to the empty string.
 void set(java.math.BigDecimal value)
          Sets the value from the provided BigDecimal.
 void set(boolean value)
          Sets the value of this from the provided boolean.
 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.
 
Methods inherited from interface at.spardat.xma.mdl.IAtomic
getEncodedValue, getType, hasValue, isTrue, toBigDecimal, toByte, toBYTE, toDate, toDouble, toDOUBLE, toFloat, toFLOAT, toInt, toINTEGER, toLong, toLONG, toShort, toSHORT, toString, toString
 

Method Detail

clear

public void clear()
Sets this TextModel to the empty string.


set

public void set(java.lang.String value)
Sets the value of this model from a string. Clears this if value==null.

Parameters:
value - the string to set
Throws:
java.lang.IllegalStateException - if getType() is not equal to T_STRING or T_DOM.

set

public void set(double value,
                int precision)
Sets the value from a double.

Parameters:
value - the value to set
precision - the number of places after the comma used when converting the double to a string.
Throws:
java.lang.IllegalStateException - if getType() is not equal to T_BCD or if the provided double is NaN or Infinity.

set

public void set(double value)
Sets the value from a double. If the provided double (which is binary coded) would result in an unexact decimal representation, the fractional part of the result is stripped so that there are no more then 15 significant digits.

Parameters:
value - the value to set
Throws:
java.lang.IllegalStateException - if getType() is not equal to T_BCD or if the provided double is NaN or Infinity.

set

public void set(java.math.BigDecimal value)
Sets the value from the provided BigDecimal. Clears this if value is null.

Throws:
java.lang.IllegalStateException - if the type of this is not numeric.

set

public void set(int value)
Sets this from an int.

Parameters:
value - the provided integer to set.
Throws:
java.lang.IllegalStateException - if the type of this is not T_BCD.

set

public void set(java.util.Date value)
Sets this from a provided java.util.Date.

Parameters:
value - the value to set
Throws:
java.lang.IllegalStateException - if the type of this is not equal to T_DATE or T_TIMESTAMP.

set

public void set(boolean value)
Sets the value of this from the provided boolean.

Parameters:
value - the boolean value to set
Throws:
java.lang.IllegalStateException - if the type of this is not T_BOOLEAN.

set

public void set(java.lang.Boolean val)
Sets the value from a Boolean. If val is null, this is cleared.

Parameters:
val - the value to set
Throws:
java.lang.IllegalStateException - if the type of this is not T_BOOLEAN

set

public void set(java.lang.Byte val)
Sets the value from a Byte.

If the value is null, this is cleared.

Throws:
java.lang.IllegalStateException - if the type of this is not T_BCD

set

public void set(java.lang.Short val)
Sets the value from a Short.

If the value is null, this is cleared.

Throws:
java.lang.IllegalStateException - if the type of this is not T_BCD

set

public void set(java.lang.Integer val)
Sets the value from an Integer.

If the value is null, this is cleared.

Throws:
java.lang.IllegalStateException - if the type of this is not T_BCD

set

public void set(java.lang.Long val)
If the value is null, this is cleared.

Throws:
java.lang.IllegalStateException - if the type of this is not T_BCD

set

public void set(java.lang.Float val)
If the value is null, this is cleared.

Throws:
java.lang.IllegalStateException - if the type of this is not T_BCD

set

public void set(java.lang.Double val)
Sets the value from a Double.

If the value is null, this is cleared.

Throws:
java.lang.IllegalStateException - if the type of this is not T_BCD