JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.value
Interface JCValueModel

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractValueModel

public interface JCValueModel
extends Serializable

Interface for creating value models.


Method Summary
 void addValueListener(com.klg.jclass.util.value.JCValueListener listener)
          Adds a listener for changes to the value.
 Object getValue()
          Returns the internal core value.
 Class getValueClass()
          Returns the type of the core value.
 void removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
          Removes a listener for changes to the value.
 void setValue(Object value)
          Sets the internal core value.
 void setValue(Object value, boolean exitOnDetectingEquality)
          Sets the internal core value but optionally exits before setting the value (after the valueChanging event, but before the valueChanged event) if the new and old values are equal.
 

Method Detail

addValueListener

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

Parameters:
listener - The listener to add

removeValueListener

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

Parameters:
listener - The listener to remove

setValue

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

Parameters:
value - The new value

setValue

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

Parameters:
exitOnDetectingEquality - If true, nothing is done if the new value equals the existing value.
value - The new value

getValue

public Object getValue()
Returns the internal core value.

Returns:
internal core value

getValueClass

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

Returns:
type of the core value

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