Convert the value according the type of DeviceData.

@param deviceDataArgout
the DeviceData attribute to read
@return Float, the result in Float format
@throws DevFailed
499776
public static Float extractToFloat(final DeviceData deviceDataArgout) throws DevFailed {
	final Object value = CommandHelper.extract(deviceDataArgout);
	Float argout = null;
	if (value instanceof Short) {
	    argout = Float.valueOf(((Short) value).floatValue());
	} else if (value instanceof String) {
	    try {
		argout = Float.valueOf((String) value);
	    } catch (final Exception e) {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type " + value
			+ " is not a numerical", "CommandHelper.extractToFloat(deviceDataArgin)");
	    }
	} else if (value instanceof Integer) {
	    argout = Float.valueOf(((Integer) value).floatValue());
	} else if (value instanceof Long) {
	    argout = Float.valueOf(((Long) value).floatValue());
	} else if (value instanceof Float) {
	    argout = Float.valueOf(((Float) value).floatValue());
	} else if (value instanceof Boolean) {
	    if (((Boolean) value).booleanValue()) {
		argout = Float.valueOf(1);
	    } else {
		argout = Float.valueOf(0);
	    }
	} else if (value instanceof Double) {
	    argout = Float.valueOf(((Double) value).floatValue());
	} else if (value instanceof DevState) {
	    argout = Float.valueOf(Integer.valueOf(((DevState) value).value()).floatValue());
	} else {
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type " + value.getClass()
		    + " not supported",
		    "CommandHelper.extractToFloat(Object value,deviceDataArgin)");
	}

	return argout;
    }
690405
public long[] extractULongArray() throws DevFailed {
		manageExceptions("extractULong");
		if (use_union) {
	    	final int[] array = attributeValue_5.value.ulong_att_value();
	    	long mask = 0x7fffffff;
	    	mask += (long) 1 << 31;
	    	final long[] result = new long[array.length];
	    	for (int i = 0; i < array.length; i++) {
			result[i] = mask & array[i];
	    	}
	    	return result;
		} else {
	    	return deviceAttribute_3.extractULongArray();
		}
    }
39854
public static Object extract(final DeviceData deviceDataArgout) throws DevFailed {
	Object argout = null;
	switch (deviceDataArgout.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    argout = Short.valueOf(deviceDataArgout.extractShort());
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    argout = Integer.valueOf(deviceDataArgout.extractUShort()).shortValue();
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "out type Tango_DEV_CHAR not supported",
		    "CommandHelper.extract(deviceDataArgout)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "out type Tango_DEV_UCHAR not supported",
		    "CommandHelper.extract(deviceDataArgout)");
	    break;
	case TangoConst.Tango_DEV_LONG:
	    argout = Integer.valueOf(deviceDataArgout.extractLong());
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    argout = Long.valueOf(deviceDataArgout.extractULong());
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    argout = Long.valueOf(deviceDataArgout.extractLong64());
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    argout = Long.valueOf(deviceDataArgout.extractULong64());
	    break;
	case TangoConst.Tango_DEV_INT:
	    argout = Integer.valueOf(deviceDataArgout.extractLong());
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    argout = Float.valueOf(deviceDataArgout.extractFloat());
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    argout = Double.valueOf(deviceDataArgout.extractDouble());
	    break;
	case TangoConst.Tango_DEV_STRING:
	    argout = deviceDataArgout.extractString();
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    argout = Boolean.valueOf(deviceDataArgout.extractBoolean());
	    break;
	case TangoConst.Tango_DEV_STATE:
	    argout = deviceDataArgout.extractDevState();
	    break;
	case TangoConst.Tango_DEVVAR_DOUBLESTRINGARRAY:
	    argout = deviceDataArgout.extractDoubleStringArray();
	    break;
	case TangoConst.Tango_DEVVAR_LONGSTRINGARRAY:
	    argout = deviceDataArgout.extractLongStringArray();
	    break;
	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type "
		    + deviceDataArgout.getType() + " not supported",
		    "CommandHelper.extract(Short value,deviceDataArgout)");
	    break;
	}

	return argout;
    }
1278437
public static void insertFromDevVarLongStringArray(final DevVarLongStringArray value,
	    final DeviceData deviceDataArgin, final int dataType) throws DevFailed {
	if (dataType == TangoConst.Tango_DEVVAR_LONGSTRINGARRAY) {
	    deviceDataArgin.insert(value);
	} else {
	    Except
		    .throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
			    + deviceDataArgin.getType() + " not supported",
			    "CommandHelper.insertFromDevVarLongStringArray(DevVarLongStringArray value,deviceDataArgin)");
	}
    }
1213243
public static Float extractToFloat(final DeviceAttribute deviceAttributeRead) throws DevFailed {
	final Object value = AttributeHelper.extract(deviceAttributeRead);
	Float argout = null;
	if (value instanceof Short) {
	    argout = Float.valueOf(((Short) value).floatValue());
	} else if (value instanceof String) {
	    try {
		argout = Float.valueOf((String) value);
	    } catch (final Exception e) {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type " + value
			+ " is not a numerical",
			"AttributeHelper.extractToFloat(deviceAttributeWritten)");
	    }
	} else if (value instanceof Integer) {
	    argout = Float.valueOf(((Integer) value).floatValue());
	} else if (value instanceof Long) {
	    argout = Float.valueOf(((Long) value).floatValue());
	} else if (value instanceof Float) {
	    argout = Float.valueOf(((Float) value).floatValue());
	} else if (value instanceof Boolean) {
	    if (((Boolean) value).booleanValue()) {
		argout = Float.valueOf(1);
	    } else {
		argout = Float.valueOf(0);
	    }
	} else if (value instanceof Double) {
	    argout = Float.valueOf(((Double) value).floatValue());
	} else if (value instanceof DevState) {
	    argout = Float.valueOf(Integer.valueOf(((DevState) value).value()).floatValue());
	} else {
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type " + value.getClass()
		    + " not supported",
		    "AttributeHelper.extractToFloat(Object value,deviceAttributeWritten)");
	}

	return argout;
    }
572855
public static String[] extractToStringArray(final DeviceData deviceDataArgout) throws DevFailed {
	final Object[] values = CommandHelper.extractArray(deviceDataArgout);
	if (values == null) {
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output is empty ",
		    "CommandHelper.extractToStringArray(deviceDataArgin)");
	}
	final String[] argout = new String[values.length];

	if (values.length > 0) {
	    if (values[0] instanceof Short) {
		for (int i = 0; i < values.length; i++) {
		    argout[i] = ((Short) values[i]).toString();
		}
	    } else if (values[0] instanceof String) {
		for (int i = 0; i < values.length; i++) {
		    argout[i] = (String) values[i];
		}

	    } else if (values[0] instanceof Integer) {
		for (int i = 0; i < values.length; i++) {
		    argout[i] = ((Integer) values[i]).toString();
		}
	    } else if (values[0] instanceof Long) {
		for (int i = 0; i < values.length; i++) {
		    argout[i] = ((Long) values[i]).toString();
		}
	    } else if (values[0] instanceof Float) {
		for (int i = 0; i < values.length; i++) {
		    argout[i] = ((Float) values[i]).toString();
		}
	    } else if (values[0] instanceof Boolean) {
		for (int i = 0; i < values.length; i++) {
		    argout[i] = ((Boolean) values[i]).toString();
		}
	    } else if (values[0] instanceof Double) {
		for (int i = 0; i < values.length; i++) {
		    argout[i] = ((Double) values[i]).toString();
		}
	    } else if (values[0] instanceof Byte) {
		for (int i = 0; i < values.length; i++) {
		    argout[i] = ((Byte) values[i]).toString();
		}
	    } else if (values[0] instanceof DevState) {
		for (int i = 0; i < values.length; i++) {
		    argout[i] = StateUtilities.getNameForState((DevState) values[0]);
		}
	    } else {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type "
			+ values[0].getClass() + " not supported",
			"CommandHelper.extractToStringArray(Object value,deviceDataArgin)");
	    }
	}
	return argout;
    }
172089
public DbAttribute get_device_attribute_property(Database database, String deviceName, String attname)
            throws DevFailed {
        String[] attnames = new String[1];
        attnames[0] = attname;
        return get_device_attribute_property(database, deviceName, attnames)[0];
    }
881980
public void poll_attribute(final DeviceProxy deviceProxy, final String attname, final int period)
	    throws DevFailed {
    	poll_object(deviceProxy, attname, "attribute", period);
    }
683096
public int argoutType(String cmdname) throws DevFailed
	{
		for (CommandInfo info : cmd_info)
			if (cmdname.equals(info.cmd_name))
				return info.out_type;

		Except.throw_non_supported_exception("TACO_CMD_UNAVAILABLE",
				cmdname + " command unknown for device " + devname,
				"DevVarCmdArray.argoutType()");
		return -1;
	}
793470
public DbAttribute[] get_device_attribute_property(String devname, String[] attnames) throws DevFailed {
		return databaseDAO.get_device_attribute_property(this, devname, attnames);
	}
983381
public static Object[] extractArray(final DeviceAttribute deviceAttributeRead) throws DevFailed {
	Object[] argout = null;
	switch (deviceAttributeRead.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    final short[] simpleShortValues = deviceAttributeRead.extractShortArray();
	    argout = new Object[simpleShortValues.length];
	    for (int i = 0; i < simpleShortValues.length; i++) {
		argout[i] = Short.valueOf(simpleShortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    final int[] simpleUshortValues = deviceAttributeRead.extractUShortArray();
	    argout = new Object[simpleUshortValues.length];
	    for (int i = 0; i < simpleUshortValues.length; i++) {
		argout[i] = Integer.valueOf(simpleUshortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "output type Tango_DEV_CHAR not supported",
		    "AttributeHelper.extractArray(deviceAttributeWritten)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    final byte[] byteValues = deviceAttributeRead.extractCharArray();
	    argout = new Object[byteValues.length];
	    for (int i = 0; i < byteValues.length; i++) {
		argout[i] = Byte.valueOf(byteValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_LONG:
	    final int[] simpleLongValues = deviceAttributeRead.extractLongArray();
	    argout = new Object[simpleLongValues.length];
	    for (int i = 0; i < simpleLongValues.length; i++) {
		argout[i] = Integer.valueOf(simpleLongValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    final long[] simpleUlongValues = deviceAttributeRead.extractULongArray();
	    argout = new Object[simpleUlongValues.length];
	    for (int i = 0; i < simpleUlongValues.length; i++) {
		argout[i] = Long.valueOf(simpleUlongValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    final long[] simpleLong64Values = deviceAttributeRead.extractLong64Array();
	    argout = new Object[simpleLong64Values.length];
	    for (int i = 0; i < simpleLong64Values.length; i++) {
		argout[i] = Long.valueOf(simpleLong64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    final long[] simpleUlong64Values = deviceAttributeRead.extractULong64Array();
	    argout = new Object[simpleUlong64Values.length];
	    for (int i = 0; i < simpleUlong64Values.length; i++) {
		argout[i] = Long.valueOf(simpleUlong64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_INT:
	    final int[] simpleIntValues = deviceAttributeRead.extractLongArray();
	    argout = new Object[simpleIntValues.length];
	    for (int i = 0; i < simpleIntValues.length; i++) {
		argout[i] = Integer.valueOf(simpleIntValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    final float[] simpleFloatValues = deviceAttributeRead.extractFloatArray();
	    argout = new Object[simpleFloatValues.length];
	    for (int i = 0; i < simpleFloatValues.length; i++) {
		argout[i] = Float.valueOf(simpleFloatValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    final double[] simpleDoubleValues = deviceAttributeRead.extractDoubleArray();
	    argout = new Object[simpleDoubleValues.length];
	    for (int i = 0; i < simpleDoubleValues.length; i++) {
		argout[i] = Double.valueOf(simpleDoubleValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_STRING:
	    final String[] simpleStringValues = deviceAttributeRead.extractStringArray();
	    argout = new Object[simpleStringValues.length];
	    for (int i = 0; i < simpleStringValues.length; i++) {
		argout[i] = simpleStringValues[i];
	    }
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    final boolean[] simpleBooleanValues = deviceAttributeRead.extractBooleanArray();
	    argout = new Object[simpleBooleanValues.length];
	    for (int i = 0; i < simpleBooleanValues.length; i++) {
		argout[i] = Boolean.valueOf(simpleBooleanValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEV_STATE:
	    argout = new Object[] { deviceAttributeRead.extractDevState() };
	    break;

	// Array input type
	case TangoConst.Tango_DEVVAR_SHORTARRAY:
	    final short[] shortValues = deviceAttributeRead.extractShortArray();
	    argout = new Object[shortValues.length];
	    for (int i = 0; i < shortValues.length; i++) {
		argout[i] = Short.valueOf(shortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_USHORTARRAY:
	    final int[] ushortValues = deviceAttributeRead.extractUShortArray();
	    argout = new Object[ushortValues.length];
	    for (int i = 0; i < ushortValues.length; i++) {
		argout[i] = Integer.valueOf(ushortValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_CHARARRAY:
	    final byte[] charValues = deviceAttributeRead.extractCharArray();
	    argout = new Object[charValues.length];
	    for (int i = 0; i < charValues.length; i++) {
		argout[i] = Byte.valueOf(charValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_LONGARRAY:
	    final int[] longValues = deviceAttributeRead.extractLongArray();
	    argout = new Object[longValues.length];
	    for (int i = 0; i < longValues.length; i++) {
		argout[i] = Integer.valueOf(longValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_ULONGARRAY:
	    final long[] ulongValues = deviceAttributeRead.extractULongArray();
	    argout = new Object[ulongValues.length];
	    for (int i = 0; i < ulongValues.length; i++) {
		argout[i] = Long.valueOf(ulongValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_LONG64ARRAY:
	    final long[] long64Values = deviceAttributeRead.extractLong64Array();
	    argout = new Object[long64Values.length];
	    for (int i = 0; i < long64Values.length; i++) {
		argout[i] = Long.valueOf(long64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_ULONG64ARRAY:
	    final long[] ulong64Values = deviceAttributeRead.extractULong64Array();
	    argout = new Object[ulong64Values.length];
	    for (int i = 0; i < ulong64Values.length; i++) {
		argout[i] = Long.valueOf(ulong64Values[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_FLOATARRAY:
	    final float[] floatValues = deviceAttributeRead.extractFloatArray();
	    argout = new Object[floatValues.length];
	    for (int i = 0; i < floatValues.length; i++) {
		argout[i] = Float.valueOf(floatValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_DOUBLEARRAY:
	    final double[] doubleValues = deviceAttributeRead.extractDoubleArray();
	    argout = new Object[doubleValues.length];
	    for (int i = 0; i < doubleValues.length; i++) {
		argout[i] = Double.valueOf(doubleValues[i]);
	    }
	    break;
	case TangoConst.Tango_DEVVAR_STRINGARRAY:
	    final String[] stringValues = deviceAttributeRead.extractStringArray();
	    argout = new Object[stringValues.length];
	    for (int i = 0; i < stringValues.length; i++) {
		argout[i] = stringValues[i];
	    }
	    break;

	case TangoConst.Tango_DEVVAR_LONGSTRINGARRAY:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "output type Tango_DEVVAR_LONGSTRINGARRAY not supported",
		    "AttributeHelper.insertFromShortArray(short[] values,deviceAttributeWritten)");
	    break;
	case TangoConst.Tango_DEVVAR_DOUBLESTRINGARRAY:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "output type Tango_DEVVAR_DOUBLESTRINGARRAY not supported",
		    "AttributeHelper.insertFromShortArray(short[] values,deviceAttributeWritten)");
	    break;

	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "output type "
		    + deviceAttributeRead.getType() + " not supported",
		    "AttributeHelper.insertFromShort(Short value,deviceAttributeWritten)");
	    break;
	}
	return argout;
    }
1043815
public com.google.protobuf.ByteString
      getDeviceTypeBytes() {
    java.lang.Object ref = deviceType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      deviceType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
1321974
public DeviceAttribute[] read_attribute(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {
        Except.throw_exception("Api_TacoFailed",
                "Taco protocol not supported",
                "TacoTangoDeviceDAODefaultImpl.command_inout()");
        return null;
    }
334898
public int getType(final DeviceData deviceData) throws DevFailed {
        int type = Tango_DEV_VOID;
        boolean is_array = false;
        boolean is_struct = false;
        TypeCode tc = deviceData.getAny().type();
        TCKind kind;
        try {

            // Special case for state
            if (tc.kind().value()==TCKind._tk_enum) {
                return Tango_DEV_STATE;
            }

            // Check if struct
            if (tc.kind().value()==TCKind._tk_struct) {
                is_struct = true;
                // Get first element of struct
                tc = tc.member_type(0);
            }

            // Check if array
            if (tc.kind().value()==TCKind._tk_alias) {
                final TypeCode tc_alias = tc.content_type();
                if (tc_alias.kind().value()==TCKind._tk_sequence) {
                    final TypeCode tc_seq = tc_alias.content_type();
                    kind = tc_seq.kind();
                    is_array = true;
                } else {
                    kind = tc_alias.kind();
                }
            } else {
                kind = tc.kind();
            }

            // Set Tango type from TypeCode
            switch (kind.value()) {
                case TCKind._tk_void:
                    type = Tango_DEV_VOID;
                    break;

                case TCKind._tk_boolean:
                    if (is_array) {
                        type = Tango_DEVVAR_BOOLEANARRAY;
                    }
                    else {
                        type = Tango_DEV_BOOLEAN;
                    }
                    break;

                case TCKind._tk_char:
                case TCKind._tk_octet:
                    if (is_array) {
                        type = Tango_DEVVAR_CHARARRAY;
                    } else {
                        type = Tango_DEV_CHAR;
                    }
                    break;

                case TCKind._tk_short:
                    if (is_array) {
                        type = Tango_DEVVAR_SHORTARRAY;
                    } else {
                        type = Tango_DEV_SHORT;
                    }
                    break;

                case TCKind._tk_ushort:
                    if (is_array) {
                        type = Tango_DEVVAR_USHORTARRAY;
                    } else {
                        type = Tango_DEV_USHORT;
                    }
                    break;

                case TCKind._tk_long:
                    if (is_struct) {
                        type = Tango_DEVVAR_LONGSTRINGARRAY;
                    } else if (is_array) {
                        type = Tango_DEVVAR_LONGARRAY;
                    } else {
                        type = Tango_DEV_LONG;
                    }
                    break;

                case TCKind._tk_ulong:
                    if (is_array) {
                        type = Tango_DEVVAR_ULONGARRAY;
                    } else {
                        type = Tango_DEV_ULONG;
                    }
                    break;

                case TCKind._tk_longlong:
                    if (is_array) {
                        type = Tango_DEVVAR_LONG64ARRAY;
                    } else {
                        type = Tango_DEV_LONG64;
                    }
                    break;

                case TCKind._tk_ulonglong:
                    if (is_array) {
                        type = Tango_DEVVAR_ULONG64ARRAY;
                    } else {
                        type = Tango_DEV_ULONG64;
                    }
                    break;

                case TCKind._tk_float:
                    if (is_array) {
                        type = Tango_DEVVAR_FLOATARRAY;
                    } else {
                        type = Tango_DEV_FLOAT;
                    }
                    break;

                case TCKind._tk_double:
                    if (is_struct) {
                        type = Tango_DEVVAR_DOUBLESTRINGARRAY;
                    } else if (is_array) {
                        type = Tango_DEVVAR_DOUBLEARRAY;
                    } else {
                        type = Tango_DEV_DOUBLE;
                    }
                    break;

                case TCKind._tk_string:
                    if (is_array) {
                        type = Tango_DEVVAR_STRINGARRAY;
                    } else {
                        type = Tango_DEV_STRING;
                    }
                    break;
            }
        } catch (final org.omg.CORBA.TypeCodePackage.BadKind e) {
            // e.printStackTrace();
            Except.throw_exception("Api_TypeCodePackage.BadKind", "Bad or unknown type ",
                    "DeviceAttribute.getType()");
        } catch (final org.omg.CORBA.TypeCodePackage.Bounds e) {
            Except.throw_exception("Api_TypeCodePackage.BadKind", "Bad or unknown type ",
                    "DeviceAttribute.getType()");
        }
        return type;
    }
958388
public String getDeviceFromAlias(Database database, String alias) throws DevFailed {
        DeviceData argIn = new DeviceData();
        argIn.insert(alias);
        DeviceData argOut = command_inout(database, "DbGetAliasDevice", argIn);
        return argOut.extractString();
    }
562040
public void insert(final DeviceData deviceData, final String argin) {
        DevStringHelper.insert(deviceData.getAny(), argin);
    }
1357408
public DevVarLongStringArray extractLongStringArray(final DeviceData deviceData) {
        if (deviceData.getAny()==null) {
            System.out.println("any = null !!");
        }
        return DevVarLongStringArrayHelper.extract(deviceData.getAny());
    }