com.sas.lang
Class DoubleData

com.sas.lang.DoubleData
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, ComponentInterface, com.sas.lang.DoubleDataInterface, 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 DoubleData
implements com.sas.PublicClonable, com.sas.lang.DoubleDataInterface, com.sas.lang.StringDataInterface

DoubleData is an implementation of DoubleDataInterface, for holding a double integer. The DoubleData container has a bound doubleData property, so the DoubleData object fires a PropertyChangeEvent when the object is changed with setDoubleData(Double).

Creating a DoubleData Component

DoubleData doubleData1 = new DoubleData(); doubleData1.initialize();

The DoubleData class also maintains a bound text property which is always equal to the String value of the doubleData property.

Usage

The DoubleData component stores double data:

 doubleData1.addPropertyChangeListener(listener);
 doubleData1.setDoubleData(l);
 ...
 l = doubleData1.getDoubleData();
 

See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
           
 
Constructor Summary
DoubleData()
          Default Constructor
DoubleData(double value)
          Construct an object with an initial value.
 
Method Summary
 java.lang.Object clone()
          Creates a copy of the current model
 boolean equals(DoubleData other)
          Tests if this object equals another DoubleData object
 boolean equals(java.lang.Object object)
          Tests if this object equals another object
 double getDoubleData()
          Retrieves the double stored in the double model
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns the ExtendedBeanInfo for this class.
 java.lang.String getText()
          Retrieves the text value of the model.
 int hashCode()
          Computes a hash code.
 void setDoubleData(double value)
          Sets the double stored in the double model.
 void setText(java.lang.String string)
          Assigns the value of the object from a string value.
 java.lang.String toString()
          Returns the string representation of the object.
static java.lang.String toString(double d)
          toString converts the passed in double primitive to a String properly formatted for the current locale.
static java.lang.String toString(java.lang.Double value)
          toString converts the passed in Double object to a String properly formatted for the current locale.
static double valueOf(java.lang.String doubleString)
          valueOf converts the passed in (locale specific) String to a double.
 
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

DoubleData

public DoubleData()
Default Constructor


DoubleData

public DoubleData(double 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.Double value)
toString converts the passed in Double object to a String properly formatted for the current locale.

Parameters:
value - The Double value to convert to a String.
Returns:
A string representing the double value.

toString

public static java.lang.String toString(double d)
toString converts the passed in double primitive to a String properly formatted for the current locale.

Parameters:
value - The double value to convert to a String.
Returns:
A string representing the double value.

valueOf

public static double valueOf(java.lang.String doubleString)
valueOf converts the passed in (locale specific) String to a double.

Parameters:
doubleString - A String to convert to a double.

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

getDoubleData

public double getDoubleData()
Retrieves the double stored in the double model

Specified by:
getDoubleData in interface com.sas.lang.DoubleDataInterface
Returns:
double 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

setDoubleData

public void setDoubleData(double value)
Sets the double stored in the double model.

Specified by:
setDoubleData in interface com.sas.lang.DoubleDataInterface
Parameters:
value - double data

setText

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

Specified by:
setText in interface com.sas.lang.StringDataInterface
Parameters:
string - a string representation of the text.
Throws:
java.lang.NumberFormatException - if the string cannot be converted.

toString

public java.lang.String toString()
Returns the string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
the string representation



Copyright © 2009 SAS Institute Inc. All Rights Reserved.