TANGO Java API
( TangORB-7.3.3.jar)

fr.esrf.TangoApi.helpers
Class AttributeHelper

java.lang.Object
  extended by fr.esrf.TangoApi.helpers.AttributeHelper

public class AttributeHelper
extends java.lang.Object

This class provide useful static methods to insert or extract data from DeviceAttribute

Author:
SAINTIN, ABEILLE

Constructor Summary
AttributeHelper()
           
 
Method Summary
static java.lang.Object extract(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to an Object
static java.lang.Object[] extractArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a list of Object
static java.lang.Boolean extractToBoolean(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a Boolean.
static boolean[] extractToBooleanArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a boolean Array.
static byte[] extractToByteArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a byte Array.
static DevState extractToDevState(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a DevState.
static DevState[] extractToDevStateArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a DevState Array.
static java.lang.Double extractToDouble(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a Double.
static double[] extractToDoubleArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a double Array.
static java.lang.Float extractToFloat(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a Float
static float[] extractToFloatArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a float Array.
static java.lang.Integer extractToInteger(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to an Integer
static int[] extractToIntegerArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a int Array.
static java.lang.Long extractToLong(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a Long
static long[] extractToLongArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a long Array.
static java.lang.Short extractToShort(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a Short
static short[] extractToShortArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a short Array.
static java.lang.String extractToString(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a String
static java.lang.String[] extractToStringArray(DeviceAttribute deviceAttributeRead)
          Extract data from DeviceAttribute to a String Array.
static void fillDbDatumFromDeviceAttribute(DbDatum dbDatum, DeviceAttribute deviceAttribute)
          Fill DbDatum from value of deviceAttribute Doesn't work for case TangoConst.Tango_DEVVAR_CHARARRAY: case TangoConst.Tango_DEVVAR_ULONGARRAY: case TangoConst.Tango_DEV_LONG: case TangoConst.Tango_DEV_ULONG:
static void fillDeviceAttributeFromDbDatum(DeviceAttribute deviceAttribute, DbDatum dbDatum)
          Fill deviceAttribute from value of DbDatum Doesn't work for case TangoConst.Tango_DEVVAR_CHARARRAY: case TangoConst.Tango_DEVVAR_ULONGARRAY: case TangoConst.Tango_DEV_LONG: case TangoConst.Tango_DEV_ULONG:
static void insert(java.lang.Object value, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from an object
static void insert(java.lang.Object value, DeviceAttribute deviceAttributeWritten, int dimX, int dimY)
          Insert data in DeviceAttribute from an Object
static void insertFromArray(java.lang.Object[] values, DeviceAttribute deviceAttributeWritten, int dimX, int dimY)
          Insert data in DeviceAttribute from an Object Array
static void insertFromBoolean(java.lang.Boolean booleanValue, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from a Boolean.
static void insertFromBooleanArray(boolean[] booleanValues, DeviceAttribute deviceAttributeWritten, int dimX, int dimY)
          Insert data in DeviceAttribute from a boolean Array.
static void insertFromDevState(DevState devStateValue, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from a DevState.
static void insertFromDouble(java.lang.Double doubleValue, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from a Double.
static void insertFromDoubleArray(double[] doubleValues, DeviceAttribute deviceAttributeWritten, int dimX, int dimY)
          Insert data in DeviceAttribute from a double Array.
static void insertFromFloat(java.lang.Float floatValue, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from a Float.
static void insertFromFloatArray(float[] floatValues, DeviceAttribute deviceAttributeWritten, int dimX, int dimY)
          Insert data in DeviceAttribute from a float Array.
static void insertFromInteger(java.lang.Integer integerValue, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from a Integer.
static void insertFromIntegerArray(int[] intValues, DeviceAttribute deviceAttributeWritten, int dimX, int dimY)
          Insert data in DeviceAttribute from a int Array.
static void insertFromLong(java.lang.Long longValue, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from a Long.
static void insertFromLongArray(long[] longValues, DeviceAttribute deviceAttributeWritten, int dimX, int dimY)
          Insert data in DeviceAttribute from a long Array.
static void insertFromShort(java.lang.Short shortValue, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from a Short object.
static void insertFromShortArray(short[] shortValues, DeviceAttribute deviceAttributeWritten, int dimX, int dimY)
          Insert data in DeviceAttribute from a short Array.
static void insertFromString(java.lang.String stringValue, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from a String.
static void insertFromStringArray(java.lang.String[] stringValues, DeviceAttribute deviceAttributeWritten, int dimX, int dimY)
          Insert data in DeviceAttribute from a String Array.
static void insertFromWAttribute(WAttribute wAttributeValue, DeviceAttribute deviceAttributeWritten)
          Insert data in DeviceAttribute from a WAttribute.
static void set_value(java.lang.Object[] valueArray, Attribute attribute, int dimX, int dimY)
          Set value with an object on Attribute
static void set_value(java.lang.Object value, Attribute attribute)
          Set value with an object on Attribute
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeHelper

public AttributeHelper()
Method Detail

insert

public static void insert(java.lang.Object value,
                          DeviceAttribute deviceAttributeWritten)
                   throws DevFailed
Insert data in DeviceAttribute from an object

Parameters:
value - the value to write on DeviceAttribute, possibles Class Short, String, Long, Float, Boolean, Integer, Double, DevState, WAttribute or Vector.
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

set_value

public static void set_value(java.lang.Object value,
                             Attribute attribute)
                      throws DevFailed
Set value with an object on Attribute

Parameters:
value - the value to set on Attribute of JServer, possibles Class : Short, String, Long, Float, Boolean, Integer, Double, DevState.
attribute - the attribute to set
Throws:
DevFailed

set_value

public static void set_value(java.lang.Object[] valueArray,
                             Attribute attribute,
                             int dimX,
                             int dimY)
                      throws DevFailed
Set value with an object on Attribute

Parameters:
valueArray - the value to set on Attribute of JServer, possibles Class : Short, String, Long, Float, Boolean, Integer, Double, DevState.
attribute - the attribute to set
dimX - the x dimension of the attribute
dimY - the y dimension of the attribute
Throws:
DevFailed

insert

public static void insert(java.lang.Object value,
                          DeviceAttribute deviceAttributeWritten,
                          int dimX,
                          int dimY)
                   throws DevFailed
Insert data in DeviceAttribute from an Object

Parameters:
value - the value to write on DeviceAttribute, possibles Class : Short, String, Long, Float, Boolean, Integer, Double, DevState or Vector.
deviceAttributeWritten - the DeviceAttribute attribute to write
dimX - the custom X dimension of the attribute to write use only if it is a Vector
dimY - the custom Y dimension of the attribute to write use only if it is a Vector
Throws:
DevFailed

extract

public static java.lang.Object extract(DeviceAttribute deviceAttributeRead)
                                throws DevFailed
Extract data from DeviceAttribute to an Object

Parameters:
deviceAttributeRead - the DeviceAttribute to read
Returns:
Object possibles Class : Short, String, Long, Float, Boolean, Integer, Double, DevState or Vector.
Throws:
DevFailed

extractArray

public static java.lang.Object[] extractArray(DeviceAttribute deviceAttributeRead)
                                       throws DevFailed
Extract data from DeviceAttribute to a list of Object

Parameters:
deviceAttributeRead - the DeviceAttribute to read
Returns:
Object[], an array of the extracted values, possible type : Short, String, Long, Float, Boolean, Integer, Double.
Throws:
DevFailed

insertFromShort

public static void insertFromShort(java.lang.Short shortValue,
                                   DeviceAttribute deviceAttributeWritten)
                            throws DevFailed
Insert data in DeviceAttribute from a Short object.

Parameters:
shortValue - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

extractToShort

public static java.lang.Short extractToShort(DeviceAttribute deviceAttributeRead)
                                      throws DevFailed
Extract data from DeviceAttribute to a Short

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
Short, the result in Short format
Throws:
DevFailed

extractToString

public static java.lang.String extractToString(DeviceAttribute deviceAttributeRead)
                                        throws DevFailed
Extract data from DeviceAttribute to a String

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
String, the result in String format
Throws:
DevFailed

extractToInteger

public static java.lang.Integer extractToInteger(DeviceAttribute deviceAttributeRead)
                                          throws DevFailed
Extract data from DeviceAttribute to an Integer

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
Integer, the result in Integer format
Throws:
DevFailed

extractToLong

public static java.lang.Long extractToLong(DeviceAttribute deviceAttributeRead)
                                    throws DevFailed
Extract data from DeviceAttribute to a Long

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
Long, the result in Long format
Throws:
DevFailed

extractToFloat

public static java.lang.Float extractToFloat(DeviceAttribute deviceAttributeRead)
                                      throws DevFailed
Extract data from DeviceAttribute to a Float

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
Float the result in Float format
Throws:
DevFailed

extractToBoolean

public static java.lang.Boolean extractToBoolean(DeviceAttribute deviceAttributeRead)
                                          throws DevFailed
Extract data from DeviceAttribute to a Boolean.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
Boolean the result in Boolean format
Throws:
DevFailed

extractToDouble

public static java.lang.Double extractToDouble(DeviceAttribute deviceAttributeRead)
                                        throws DevFailed
Extract data from DeviceAttribute to a Double.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
Double the result in Double format
Throws:
DevFailed

extractToDevState

public static DevState extractToDevState(DeviceAttribute deviceAttributeRead)
                                  throws DevFailed
Extract data from DeviceAttribute to a DevState.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
DevState the result in DevState format
Throws:
DevFailed

extractToShortArray

public static short[] extractToShortArray(DeviceAttribute deviceAttributeRead)
                                   throws DevFailed
Extract data from DeviceAttribute to a short Array.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
short[]
Throws:
DevFailed

extractToStringArray

public static java.lang.String[] extractToStringArray(DeviceAttribute deviceAttributeRead)
                                               throws DevFailed
Extract data from DeviceAttribute to a String Array.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
String[]
Throws:
DevFailed

extractToIntegerArray

public static int[] extractToIntegerArray(DeviceAttribute deviceAttributeRead)
                                   throws DevFailed
Extract data from DeviceAttribute to a int Array.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
int[]
Throws:
DevFailed

extractToLongArray

public static long[] extractToLongArray(DeviceAttribute deviceAttributeRead)
                                 throws DevFailed
Extract data from DeviceAttribute to a long Array.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
long[]
Throws:
DevFailed

extractToFloatArray

public static float[] extractToFloatArray(DeviceAttribute deviceAttributeRead)
                                   throws DevFailed
Extract data from DeviceAttribute to a float Array.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
float[]
Throws:
DevFailed

extractToBooleanArray

public static boolean[] extractToBooleanArray(DeviceAttribute deviceAttributeRead)
                                       throws DevFailed
Extract data from DeviceAttribute to a boolean Array.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
boolean[]
Throws:
DevFailed

extractToByteArray

public static byte[] extractToByteArray(DeviceAttribute deviceAttributeRead)
                                 throws DevFailed
Extract data from DeviceAttribute to a byte Array.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
byte[]
Throws:
DevFailed

extractToDoubleArray

public static double[] extractToDoubleArray(DeviceAttribute deviceAttributeRead)
                                     throws DevFailed
Extract data from DeviceAttribute to a double Array.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
double[]
Throws:
DevFailed

extractToDevStateArray

public static DevState[] extractToDevStateArray(DeviceAttribute deviceAttributeRead)
                                         throws DevFailed
Extract data from DeviceAttribute to a DevState Array.

Parameters:
deviceAttributeRead - the DeviceAttribute attribute to read
Returns:
DevState[]
Throws:
DevFailed

insertFromShortArray

public static void insertFromShortArray(short[] shortValues,
                                        DeviceAttribute deviceAttributeWritten,
                                        int dimX,
                                        int dimY)
                                 throws DevFailed
Insert data in DeviceAttribute from a short Array.

Parameters:
shortValues - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
dimX - the x dimension of the attribute
dimY - the y dimension of the attribute
Throws:
DevFailed

insertFromStringArray

public static void insertFromStringArray(java.lang.String[] stringValues,
                                         DeviceAttribute deviceAttributeWritten,
                                         int dimX,
                                         int dimY)
                                  throws DevFailed
Insert data in DeviceAttribute from a String Array.

Parameters:
stringValues - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
dimX - the x dimension of the attribute
dimY - the y dimension of the attribute
Throws:
DevFailed

insertFromIntegerArray

public static void insertFromIntegerArray(int[] intValues,
                                          DeviceAttribute deviceAttributeWritten,
                                          int dimX,
                                          int dimY)
                                   throws DevFailed
Insert data in DeviceAttribute from a int Array.

Parameters:
intValues - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
dimX - the x dimension of the attribute
dimY - the y dimension of the attribute
Throws:
DevFailed

insertFromLongArray

public static void insertFromLongArray(long[] longValues,
                                       DeviceAttribute deviceAttributeWritten,
                                       int dimX,
                                       int dimY)
                                throws DevFailed
Insert data in DeviceAttribute from a long Array.

Parameters:
longValues - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
dimX - the x dimension of the attribute
dimY - the y dimension of the attribute
Throws:
DevFailed

insertFromFloatArray

public static void insertFromFloatArray(float[] floatValues,
                                        DeviceAttribute deviceAttributeWritten,
                                        int dimX,
                                        int dimY)
                                 throws DevFailed
Insert data in DeviceAttribute from a float Array.

Parameters:
floatValues - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
dimX - the x dimension of the attribute
dimY - the y dimension of the attribute
Throws:
DevFailed

insertFromBooleanArray

public static void insertFromBooleanArray(boolean[] booleanValues,
                                          DeviceAttribute deviceAttributeWritten,
                                          int dimX,
                                          int dimY)
                                   throws DevFailed
Insert data in DeviceAttribute from a boolean Array.

Parameters:
booleanValues - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
dimX - the x dimension of the attribute
dimY - the y dimension of the attribute
Throws:
DevFailed

insertFromDoubleArray

public static void insertFromDoubleArray(double[] doubleValues,
                                         DeviceAttribute deviceAttributeWritten,
                                         int dimX,
                                         int dimY)
                                  throws DevFailed
Insert data in DeviceAttribute from a double Array.

Parameters:
doubleValues - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
dimX - the x dimension of the attribute
dimY - the y dimension of the attribute
Throws:
DevFailed

insertFromString

public static void insertFromString(java.lang.String stringValue,
                                    DeviceAttribute deviceAttributeWritten)
                             throws DevFailed
Insert data in DeviceAttribute from a String.

Parameters:
stringValue - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

insertFromInteger

public static void insertFromInteger(java.lang.Integer integerValue,
                                     DeviceAttribute deviceAttributeWritten)
                              throws DevFailed
Insert data in DeviceAttribute from a Integer.

Parameters:
integerValue - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

insertFromLong

public static void insertFromLong(java.lang.Long longValue,
                                  DeviceAttribute deviceAttributeWritten)
                           throws DevFailed
Insert data in DeviceAttribute from a Long.

Parameters:
longValue - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

insertFromFloat

public static void insertFromFloat(java.lang.Float floatValue,
                                   DeviceAttribute deviceAttributeWritten)
                            throws DevFailed
Insert data in DeviceAttribute from a Float.

Parameters:
floatValue - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

insertFromBoolean

public static void insertFromBoolean(java.lang.Boolean booleanValue,
                                     DeviceAttribute deviceAttributeWritten)
                              throws DevFailed
Insert data in DeviceAttribute from a Boolean.

Parameters:
booleanValue - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

insertFromDouble

public static void insertFromDouble(java.lang.Double doubleValue,
                                    DeviceAttribute deviceAttributeWritten)
                             throws DevFailed
Insert data in DeviceAttribute from a Double.

Parameters:
doubleValue - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

insertFromWAttribute

public static void insertFromWAttribute(WAttribute wAttributeValue,
                                        DeviceAttribute deviceAttributeWritten)
                                 throws DevFailed
Insert data in DeviceAttribute from a WAttribute.

Parameters:
wAttributeValue - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

insertFromDevState

public static void insertFromDevState(DevState devStateValue,
                                      DeviceAttribute deviceAttributeWritten)
                               throws DevFailed
Insert data in DeviceAttribute from a DevState.

Parameters:
devStateValue - the value to insert on DeviceAttribute
deviceAttributeWritten - the DeviceAttribute attribute to write
Throws:
DevFailed

insertFromArray

public static void insertFromArray(java.lang.Object[] values,
                                   DeviceAttribute deviceAttributeWritten,
                                   int dimX,
                                   int dimY)
                            throws DevFailed
Insert data in DeviceAttribute from an Object Array

Parameters:
values - the value to insert on DeviceAttribute possibles classe Short, String, Long, Float, Boolean, Integer, Double.
deviceAttributeWritten - the DeviceAttribute attribute to write
dimX - the x dimension of the attribute
dimY - the y dimension of the attribute
Throws:
DevFailed

fillDbDatumFromDeviceAttribute

public static final void fillDbDatumFromDeviceAttribute(DbDatum dbDatum,
                                                        DeviceAttribute deviceAttribute)
                                                 throws DevFailed
Fill DbDatum from value of deviceAttribute Doesn't work for case TangoConst.Tango_DEVVAR_CHARARRAY: case TangoConst.Tango_DEVVAR_ULONGARRAY: case TangoConst.Tango_DEV_LONG: case TangoConst.Tango_DEV_ULONG:

Parameters:
dbDatum - the DbDatum to fill
deviceAttribute - the DeviceAttribute that contains value
Throws:
DevFailed

fillDeviceAttributeFromDbDatum

public static final void fillDeviceAttributeFromDbDatum(DeviceAttribute deviceAttribute,
                                                        DbDatum dbDatum)
                                                 throws DevFailed
Fill deviceAttribute from value of DbDatum Doesn't work for case TangoConst.Tango_DEVVAR_CHARARRAY: case TangoConst.Tango_DEVVAR_ULONGARRAY: case TangoConst.Tango_DEV_LONG: case TangoConst.Tango_DEV_ULONG:

Parameters:
deviceAttribute - the DeviceAttribute to fill
dbDatum - the DbDatum that contains value
Throws:
DevFailed

TANGO Java API
( TangORB-7.3.3.jar)