dk.opi.io
Class IOItemWriteValue

java.lang.Object
  extended bydk.opi.io.IOItemWriteValue

public class IOItemWriteValue
extends Object

Use this class when doing bulk write of IOItems to a server, see IOServer2.writeMultipleItems(java.util.Vector)

See Also:
IOServer2.writeMultipleItems(java.util.Vector)

Field Summary
protected  String errorText
           
protected  IOItem item
           
protected  Object value
           
 
Constructor Summary
IOItemWriteValue(IOItem theItem, Object itemValue)
           
 
Method Summary
 String getErrorText()
          Returns the write result for the item after a call to IOServer2.writeMultipleItems(java.util.Vector) were completed.
 IOItem getItem()
          The IOItem to write to
 Object getItemValue()
          Returns the value to write for this item.
 void setErrorText(String newErrorText)
          Set the write result for the item.
 void setItem(IOItem newItem)
          Set the IOItem to write to
 void setItemValue(Object newItemValue)
          Set the value to write for this item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

item

protected IOItem item

value

protected Object value

errorText

protected String errorText
Constructor Detail

IOItemWriteValue

public IOItemWriteValue(IOItem theItem,
                        Object itemValue)
Method Detail

getItem

public IOItem getItem()
The IOItem to write to

Returns:
the Item value.

setItem

public void setItem(IOItem newItem)
Set the IOItem to write to

Parameters:
newItem - The new Item value.

getItemValue

public Object getItemValue()
Returns the value to write for this item. The object must be any of the supported IOItem datatypes, ie. java.lang.Integer, java.lang.String, java.lang.Boolean or the like.

Returns:
the ItemValue value.
See Also:
setItemValue(java.lang.Object)

setItemValue

public void setItemValue(Object newItemValue)
Set the value to write for this item. The object must be any of the supported IOItem datatypes, ie. java.lang.Integer, java.lang.String, java.lang.Boolean or the like. The datatypes of the values do not need to match the datatypes of the target items. However an error will be returned if a conversion cannot be done. Note: Write of array type items are also supported, ie. IOItem.DATATYPE_INTARRAY etc. You must use the native array types e.g. int[], double[] etc.

Parameters:
newItemValue - The new ItemValue value.

getErrorText

public String getErrorText()
Returns the write result for the item after a call to IOServer2.writeMultipleItems(java.util.Vector) were completed. A null value indicates a successfull write for the corresponding IOItem. A non-null value indicates an error. The String describes the error in textual form.

Returns:
the ErrorText value.

setErrorText

public void setErrorText(String newErrorText)
Set the write result for the item. Will be automatically filled in by a call to IOServer2.writeMultipleItems(java.util.Vector), so usually do not use this method.

Parameters:
newErrorText - The new ErrorText value.
See Also:
getErrorText()