com.sas.lang
Class ObjectData

com.sas.lang.ObjectData
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, ComponentInterface, com.sas.lang.ObjectDataInterface, com.sas.lang.StringDataInterface, LinkPropertiesInterface, ModelInterface, com.sas.PublicClonable, ViewInterface, MultipleValueEventSourceInterface, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class ObjectData
implements com.sas.PublicClonable, com.sas.lang.ObjectDataInterface, com.sas.lang.StringDataInterface

ObjectData is an implementation of ObjectDataInterface, a container for holding an Object. The ObjectData container has a bound objectData property, so the ObjectData object fires a PropertyChangeEvent when the object is changed with setObjectData(Object).

Creating an ObjectData Component

ObjectData objectData1 = new ObjectData(); objectData1.initialize();

Usage

The ObjectData component stores object data. This class and the other *Data components in com.sas.lang provide a convenient means of storing your application data and keeping it separate from the user interface, allowing you to change the interface more easily. For example, instead of relying on the user interface components to hold your data and linking to properties of list boxes, etc., you can instead store your data in one or more ObjectData components. Then, link your UI components to the objectData property of the ObjectData object.

For example, link the selectedObjects property of a listbox to the objectData property of a ObjectData component named selections. The rest of the application that is interested in the array of selections should link to selections.objectData instead of the list box. Now, you are free to change the user interface (for example, from a ListBox to a ComboBox or a RadioBox or a Choice component) without impacting the rest of the application, because there are no other links to the ListBox which have to be recreated if you delete the ListBox and replace it with a different UI component. You only need to recreate the single link between the choice.selectedObjects and selections.objectData properties; the rest of the application will continue to work as before.

See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
           
 
Constructor Summary
ObjectData()
          Default Constructor
ObjectData(java.lang.Object value)
          Construct an object with an initial value.
 
Method Summary
 java.lang.Object clone()
          Creates a copy of the current model
 boolean equals(java.lang.Object object)
          Tests if this object equals another object
 boolean equals(ObjectData other)
          Tests if this object equals another ObjectData object
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns the ExtendedBeanInfo for this class.
 java.lang.Object getObjectData()
          Retrieves the Object stored in the Object model
 java.lang.String getText()
          Retrieves the text value of the model.
 int hashCode()
          Computes a hash code.
 void setObjectData(java.lang.Object value)
          Sets the Object stored in the Object model.
 void setText(java.lang.String string)
          Assigns the value of the object from a string value.
 java.lang.String toString()
          Returns a String representation of the data.
static java.lang.String toString(java.lang.Object object)
          Convert an object to a string, using localized number formats for Double and Float values.
 
Methods inherited from class com.sas.Component
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getLinkInfo, getModelInterface, getRequiredInterfaces, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

ObjectData

public ObjectData()
Default Constructor


ObjectData

public ObjectData(java.lang.Object value)
Construct an object with an initial value.

Parameters:
value - the initial value
Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns the ExtendedBeanInfo for this class.

Returns:
ExtendedBeanInfo for this class

toString

public static java.lang.String toString(java.lang.Object object)
Convert an object to a string, using localized number formats for Double and Float values.

Parameters:
object - an object
Returns:
"null" if object is null, else DoubleData.toString(d.doubleValue()) for doubles, FloatData.toString(f.floatValue()) for floats, and object.toString() for all others.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates a copy of the current model

Specified by:
clone in interface com.sas.PublicClonable
Overrides:
clone in class Component
Returns:
a clone of this object
Throws:
java.lang.CloneNotSupportedException - if the object cannot be cloned

equals

public boolean equals(ObjectData other)
Tests if this object equals another ObjectData object

Returns:
true if and only if the objects have the same value.

equals

public boolean equals(java.lang.Object object)
Tests if this object equals another object

Overrides:
equals in class java.lang.Object
Returns:
true if object is not null, is an instance of ObjectData, and has the same value; false otherwise

getObjectData

public java.lang.Object getObjectData()
Retrieves the Object stored in the Object model

Specified by:
getObjectData in interface com.sas.lang.ObjectDataInterface
Returns:
Object value

getText

public java.lang.String getText()
Retrieves the text value of the model.

Specified by:
getText in interface com.sas.lang.StringDataInterface
Returns:
the text value of the model

hashCode

public int hashCode()
Computes a hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
hash code

setObjectData

public void setObjectData(java.lang.Object value)
Sets the Object stored in the Object model.

Specified by:
setObjectData in interface com.sas.lang.ObjectDataInterface
Parameters:
value - new object data

setText

public void setText(java.lang.String string)
Assigns the value of the object from a string value. This does a setObjectData(string)

Specified by:
setText in interface com.sas.lang.StringDataInterface
Parameters:
string - a string representation of the text.

toString

public java.lang.String toString()
Returns a String representation of the data.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of the data.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.