com.sas.lang
Class StringData

com.sas.lang.StringData
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
Direct Known Subclasses:
DateTimeMonitor, StatusStringData

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

StringData is an implementation of StringDataInterface, for holding a String. The StringData container has a bound stringData property, so the StringData object fires a PropertyChangeEvent when the object is changed with setStringData(String). The StringData class also maintains a bound text property which is always equal to the stringData property.

Creating a StringData Component

StringData StringData1 = new StringData(); stringData1.initialize();

Usage

The StringData component stores String data:

stringData1.addPropertyChangeListener(listener); stringData1.setStringData(l); ... l = stringData1.getStringData();

See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
           
 
Constructor Summary
StringData()
          Default constructor
StringData(java.lang.String str)
          Create a StringData model with the specified string
StringData(java.lang.StringBuffer strBuffer)
          Create a StringData model with the specified StringBuffer
 
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(StringData other)
          Tests if this object equals another StringData object
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns the ExtendedBeanInfo for this class.
 java.lang.Object getObjectData()
          Return the object stored here.
 java.lang.String getStringData()
          Retrieves the text stored in the text model.
 java.lang.String getText()
          Retrieves the text stored in the text model.
 int hashCode()
          Computes a hash code.
 void setObjectData(java.lang.Object object)
          Set the objecct stored here.
 void setStringData(java.lang.String newText)
          Sets the text stored in the text model.
 void setText(java.lang.String newText)
          Sets the text stored in the text model.
 
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

StringData

public StringData()
Default constructor


StringData

public StringData(java.lang.String str)
Create a StringData model with the specified string


StringData

public StringData(java.lang.StringBuffer strBuffer)
Create a StringData model with the specified StringBuffer

Method Detail

getExtendedBeanInfo

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

Returns:
ExtendedBeanInfo for this class

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(StringData other)
Tests if this object equals another StringData 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 StringData, and has the same value; false otherwise

getStringData

public final java.lang.String getStringData()
Retrieves the text stored in the text model. This is an alias for getText(), so that the StringData class is consistent with the other com.sas.lang.*Data classes. This method is final; if you wish to extend StringData, override the getText() method.

Returns:
the text value

getText

public java.lang.String getText()
Retrieves the text stored in the text model. The default value is "".

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

getObjectData

public final java.lang.Object getObjectData()
Return the object stored here. This is an alias for getStringData()/getText() since the object value of a StringData object is always a String value.

Specified by:
getObjectData in interface com.sas.lang.ObjectDataInterface
Returns:
the string stored in this object.

setObjectData

public final void setObjectData(java.lang.Object object)
Set the objecct stored here.

Specified by:
setObjectData in interface com.sas.lang.ObjectDataInterface
Parameters:
object - an object to store. It must be null or a String
Throws:
java.lang.ClassCastException - if object is not null or a String

hashCode

public int hashCode()
Computes a hash code.

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

setStringData

public final void setStringData(java.lang.String newText)
Sets the text stored in the text model. This method has been created for consistency with the other xxxData models which have a setxxxData method. It is simply an alias for setText(String) and is thus final. If you wish to extend StringData, override setText(String)

Parameters:
newText - the new text value

setText

public void setText(java.lang.String newText)
Sets the text stored in the text model.

Specified by:
setText in interface com.sas.lang.StringDataInterface
Parameters:
newText - the new text value If newText is null, the text is stored as ""



Copyright © 2009 SAS Institute Inc. All Rights Reserved.