JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.value
Class AbstractValueModel

java.lang.Object
  |
  +--com.klg.jclass.util.value.AbstractValueModel
All Implemented Interfaces:
JCValueModel, Serializable
Direct Known Subclasses:
AbstractBindingValueModel, BigDecimalValueModel, BooleanValueModel, ByteValueModel, CalendarValueModel, DateValueModel, DoubleValueModel, FloatValueModel, IntegerValueModel, IPAddressValueModel, LongValueModel, MutableValueModel, ObjectValueModel, ShortValueModel, SqlDateValueModel, SqlTimestampValueModel, SqlTimeValueModel, StringValueModel

public abstract class AbstractValueModel
extends Object
implements JCValueModel, Serializable

This class is a base class for default value models.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.util.JCListenerList listeners
          A list of value listeners who get notified when the value is about to change or has changed.
protected  Object value
          The value for this value model.
 
Constructor Summary
AbstractValueModel()
           
 
Method Summary
 void addValueListener(com.klg.jclass.util.value.JCValueListener listener)
          Adds a listener to listen for changes to the value.
 Object getValue()
          Returns the internal core value.
abstract  Class getValueClass()
          Returns the type of the core value.
 void removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
          Removes a listener that listens for changes to the value.
 void setValue(Object value)
          Sets the internal core value.
 void setValue(Object value, boolean dontProcessEqualValues)
          Sets the internal core value but optionally exits before setting the value (after the valueChanging but before the valueChanged event) if the new and old values are equal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected Object value
The value for this value model.


listeners

protected com.klg.jclass.util.JCListenerList listeners
A list of value listeners who get notified when the value is about to change or has changed.

Constructor Detail

AbstractValueModel

public AbstractValueModel()
Method Detail

addValueListener

public void addValueListener(com.klg.jclass.util.value.JCValueListener listener)
Adds a listener to listen for changes to the value.

Specified by:
addValueListener in interface JCValueModel
Parameters:
listener - The listener to add

removeValueListener

public void removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
Removes a listener that listens for changes to the value.

Specified by:
removeValueListener in interface JCValueModel
Parameters:
listener - The listener to remove

setValue

public void setValue(Object value)
Sets the internal core value. Calls setValue(value, true). In other words, dontProcessEqualValues is set to true.

Specified by:
setValue in interface JCValueModel
Parameters:
value - The new value

setValue

public void setValue(Object value,
                     boolean dontProcessEqualValues)
Sets the internal core value but optionally exits before setting the value (after the valueChanging but before the valueChanged event) if the new and old values are equal.

Specified by:
setValue in interface JCValueModel
Parameters:
value - The new value
dontProcessEqualValues - If true and the new value is the same object as the new value, don't send any events (i.e. don't go thru the valueChanging and valueChanged process).

getValue

public Object getValue()
Returns the internal core value.

Specified by:
getValue in interface JCValueModel
Returns:
The current value

getValueClass

public abstract Class getValueClass()
Returns the type of the core value. It is necessary to store the class of the value separate from the object since if the value object is null then the class information is lost.

Specified by:
getValueClass in interface JCValueModel
Returns:
The class of the value for this value model

Copyright © 2004 Quest Software Inc..
All rights reserved.