jp.gr.javacons.jim
クラス DataHolder

java.lang.Object
  |
  +--jp.gr.javacons.jim.DataHolder

public class DataHolder
extends Object
implements Serializable

DataHolder is an object class which holds the data exchanged between a DataProvider Bean and a GUI Bean. Normally, a DataProvider Bean converts information from the monitored device into a Java object, and stores it in a DataHolder object.

The DataHolder object holds the value, time stamp, and quality flag information, as data, which changes during run-time. If this information is changed by the setValue method, the event is informed to other objects that are registered as listeners to the DataHolder object.

In addition, the DataHolder object maintains a dataHolderName as well as other various parameters. At design-time, those settings can be modified using the editor for configuring DataProvider and GUI Beans.

関連項目:
直列化された形式

コンストラクタの概要
DataHolder()
          DataHolder constructor
 
メソッドの概要
 boolean addDataParameterChangeListener(DataParameterChangeListener listener)
          This adds the DataParameterChangeListener object.
 boolean addDataValueChangeListener(DataValueChangeListener listener)
          This adds the DataValueChangeListener object.
 void asyncRead()
          This method calls the corresponding read method of the DataProvider object that holds this DataHolder object.
 void asyncWrite()
          This method calls the corresponding write method of the DataProvider object that holds this DataHolder object.
 boolean containsParameterName(String paraName)
           
 String getDataHolderName()
          This returns the dataHolderName.
 DataProvider getDataProvider()
          This returns the DataProvider object that holds this DataHolder object.
 Object getParameter(String paraName)
          This returns the parameter value corresponding to the argument.
 Component getParameterEditor()
          This returns the DataHolder parameter configuration editor corresponding to this DataHolder object.
 String[] getParameterNames()
          This returns a list of the existing parameter names.
 QualityFlag getQualityFlag()
          This returns the quality flag information.
 Date getTimeStamp()
          This returns the time stamp information.
 Object getValue()
          This returns the value.
 Class getValueClass()
          This returns the Class object that represents the class of the object that can be set for the value.
 boolean isDataParameterChangeListenersEmpty()
           
 boolean isDataValueChangeListenersEmpty()
           
 boolean removeDataParameterChangeListener(DataParameterChangeListener listener)
          This removes the DataParameterChangeListener object.
 boolean removeDataValueChangeListener(DataValueChangeListener listener)
          This removes the DataValueChangeListener object.
 void setDataHolderName(String newName)
          Sets newName as the dataHolderName.
 void setDataProvider(DataProvider dp)
          Sets a DataProvider object.
 void setInitialParameter(String[] paraNames, Object[] paraValues)
          Sets the parameter types and initial values.
 void setInitialParameter(String paraName, Object paraValue)
          Sets the parameter type and initial value.
 void setInitialValueClass(Class valueClass)
          Sets the class of the object, which will be held by value.
 void setParameter(String[] paraNames, Object[] paraValues)
          This sets the parameter value corresponding to the parameter name given by the argument, and generates a DataParameterChangeEvent.
 void setParameter(String paraName, Object paraValue)
          This sets the parameter value corresponding to the parameter name given by the argument, and generates a DataParameterChangeEvent.
 void setValue(Object val, Date ts, QualityFlag qf)
          This changes information that relates to the value, and generates a DataValueChangeEvent.
 void syncRead()
          This method calls the corresponding read method of the DataProvider object that holds this DataHolder object.
 void syncWrite()
          This method calls the corresponding write method of the DataProvider object that holds this DataHolder object.
 String toString()
           
 
クラス java.lang.Object から継承したメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

DataHolder

public DataHolder()
DataHolder constructor
メソッドの詳細

addDataParameterChangeListener

public boolean addDataParameterChangeListener(DataParameterChangeListener listener)
This adds the DataParameterChangeListener object. If the members of the listeners already registered with this DataHolder object change after the execution of this method, true is returned, otherwise false.

addDataValueChangeListener

public boolean addDataValueChangeListener(DataValueChangeListener listener)
This adds the DataValueChangeListener object. If the members of the listeners already registered with this DataHolder object change after the execution of this method, true is returned, otherwise false.

asyncRead

public void asyncRead()
               throws DataProviderDoesNotSupportException
This method calls the corresponding read method of the DataProvider object that holds this DataHolder object.

A DataProviderDoesNotSupportException is thrown if the corresponding method of the DataProvider object is not supported.

An IllegalStateException is thrown if this DataHolder object is not held by any DataProvider object.


asyncWrite

public void asyncWrite()
                throws DataProviderDoesNotSupportException
This method calls the corresponding write method of the DataProvider object that holds this DataHolder object.

A DataProviderDoesNotSupportException is thrown if the corresponding method of the DataProvider object is not supported.

An IllegalStateException is thrown if this DataHolder object is not held by any DataProvider object.


containsParameterName

public boolean containsParameterName(String paraName)

getDataHolderName

public String getDataHolderName()
This returns the dataHolderName. (Specifically, the character string, which corresponds to the key "name" in the parameters, is returned.)

getDataProvider

public DataProvider getDataProvider()
This returns the DataProvider object that holds this DataHolder object. If not yet held by any DataProvider object, null is returned.

getParameter

public Object getParameter(String paraName)
This returns the parameter value corresponding to the argument.

An IllegalArgumentException is thrown if the parameter corresponding to the argument does not exist.


getParameterEditor

public Component getParameterEditor()
This returns the DataHolder parameter configuration editor corresponding to this DataHolder object. The returned editor must have the DataParameterEditor interface implemented. A return value of null indicates that no editor is supported.

getParameterNames

public String[] getParameterNames()
This returns a list of the existing parameter names.

getQualityFlag

public QualityFlag getQualityFlag()
This returns the quality flag information. Null is returned if there is no setting.

getTimeStamp

public Date getTimeStamp()
This returns the time stamp information. Null is returned if there is no setting.

getValue

public Object getValue()
This returns the value. Null is returned if there is no setting.

getValueClass

public Class getValueClass()
This returns the Class object that represents the class of the object that can be set for the value.

In the case of no special redefinition in a subclass, the Class object set by the setInitialValueClass method immediately after generation of DataHolder object is returned.

An IllegalStateException is thrown if the Class object has not been set yet.


isDataParameterChangeListenersEmpty

public boolean isDataParameterChangeListenersEmpty()

isDataValueChangeListenersEmpty

public boolean isDataValueChangeListenersEmpty()

removeDataParameterChangeListener

public boolean removeDataParameterChangeListener(DataParameterChangeListener listener)
This removes the DataParameterChangeListener object. If the members of the listeners already registered with this DataHolder object change after the execution of this method, true is returned, otherwise false.

removeDataValueChangeListener

public boolean removeDataValueChangeListener(DataValueChangeListener listener)
This removes the DataValueChangeListener object. If the members of the listeners already registered with this DataHolder object change after the execution of this method, true is returned, otherwise false.

setDataHolderName

public void setDataHolderName(String newName)
Sets newName as the dataHolderName. The name change is notified to the Manager object if it is held by some DataProvider objects. If newName is not a valid name, an IllegalArgumentException is thrown (i.e., if newName is null or "", or an invalid character is included, or if another DataHolder object with this name already exists in the DataProvider object which holds it).

setDataProvider

public void setDataProvider(DataProvider dp)
Sets a DataProvider object.

This method should not be called from other methods than the addDataHolder and removeDataHolder methods of DataProvider. In the addDataHolder methodof DataProvider, this setDataProvider method must be called after the DataProvider object adds this DataHolder object in it and becomes the state in which a return value of the getDataHolder method of DataProvider is this DataHolder obejct.

An IllegalArgumentException is thrown if a return value of the getDataHolder object of the DataProvider object provided as an argument is not this DataHolder object. (The getDataHolder method of DataProvider must return a DataHolder object even if the owner of the added DataHolder object has not been set yet)


setInitialParameter

public void setInitialParameter(String[] paraNames,
                                Object[] paraValues)
Sets the parameter types and initial values.

Normally, this method is called immediately after creation of an instance of DataHolder but prior to it being held by a DataProvider object.

The "name" and "valueClass" cannot be used in the parameter name argument.

An IllegalStateException is thrown if this method is called when already held by a DataProvider object. An IllegalParameterException is thrown if "name" or "valueClass" is used as the paraName(s) argument.


setInitialParameter

public void setInitialParameter(String paraName,
                                Object paraValue)
Sets the parameter type and initial value.

Normally, this method is called immediately after creation of an instance of DataHolder but prior to it being held by a DataProvider object.

The "name" and "valueClass" cannot be used in the parameter name argument.

An IllegalStateException is thrown if this method is called when already held by a DataProvider object. An IllegalParameterException is thrown if "name" or "valueClass" is used as the paraName(s) argument.


setInitialValueClass

public void setInitialValueClass(Class valueClass)
Sets the class of the object, which will be held by value.

Normally, this method is called immediately after creation of an instance of DataHolder, but prior to being held by a DataProvider object.

An IllegalStateException occurs if this method is called when already held by a DataProvider object. In addition, an IllegalStateException is thrown if any class has already been set, i.e., if any class is returned by the getValueClass method when this method is called. An IllegalArgumentException is thrown if null is set.


setParameter

public void setParameter(String[] paraNames,
                         Object[] paraValues)
This sets the parameter value corresponding to the parameter name given by the argument, and generates a DataParameterChangeEvent.

An IllegalParameterException is thrown if an attempt is made to set the parameter value of a parameter name not already set by the setInitialParameter method.


setParameter

public void setParameter(String paraName,
                         Object paraValue)
This sets the parameter value corresponding to the parameter name given by the argument, and generates a DataParameterChangeEvent.

An IllegalParameterException is thrown if an attempt is made to set the parameter value of a parameter name not already set by the setInitialParameter method.


setValue

public void setValue(Object val,
                     Date ts,
                     QualityFlag qf)
This changes information that relates to the value, and generates a DataValueChangeEvent. The value and the related information (time stamp and quality flag) are set in a synchronization block.

An IllegalValueClassException occurs if false is returned by the isInstance(Object) method for the Class object returned from the getValueClass method.


syncRead

public void syncRead()
              throws DataProviderDoesNotSupportException
This method calls the corresponding read method of the DataProvider object that holds this DataHolder object.

A DataProviderDoesNotSupportException is thrown if the corresponding method of the DataProvider object is not supported.

An IllegalStateException is thrown if this DataHolder object is not held by any DataProvider object.


syncWrite

public void syncWrite()
               throws DataProviderDoesNotSupportException
This method calls the corresponding write method of the DataProvider object that holds this DataHolder object.

A DataProviderDoesNotSupportException is thrown if the corresponding method of the DataProvider object is not supported.

An IllegalStateException is thrown if this DataHolder object is not held by any DataProvider object.


toString

public String toString()
オーバーライド:
クラス Object 内の toString