DoubleArrayConverter.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright (c) 2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* Copyright (C) 1996 Active Software, Inc.
* All rights reserved.
*
* @(#) DoubleArrayConverter.java 1.15 - last change made 06/17/97
*/
/**
* Converts array of double to a string and back again.
* The string representation is a single line of
* comma-separated numbers.
*
* @version 1.15, 06/17/97
*/
public class DoubleArrayConverter extends Converter {
/**
* Converts and array of double to a string representation.
*/
double[] a = (double[]) obj;
for (int i = 0; i < a.length; i++) {
if (i != (a.length-1))
}
} else {
return (/* NOI18N */"");
}
}
/**
* Converts a string to an array of double.
*
* @exception ParseException when one of the numbers
* is badly formatted
*/
if (s != null) {
for (; st.hasMoreTokens(); ) {
try {
} catch (NumberFormatException e) {
/* JSTYLED */
throw new ParseException(Global.getMsg("sunsoft.jws.visual.rt.type.DoubleArrayConverter.Badly__formatted__doub.28") + s);
}
}
doubleValue();
return (retval);
}
}
return (null);
}
/**
* Converts an array of double (stored in an attribute) into
* a block
* of code that will create the array without using this
* converter at
* runtime.
*/
indent += 2;
indent -= 2;
}
/**
* Use convertToCodeBlock instead.
*/
return (/* NOI18N */"_tmp");
}
}