1 /* -------------------------------------------------------------------
2 * Java source file for the class StringToPrimitiveDoubleConverter
3 *
4 * Copyright (c), 2002, Masahiro Takatsuka.
5 * All Rights Researved.
6 *
7 * Original Author: Masahiro Takatsuka (masa@jbeans.net)
8 * $Author: takatsukam $
9 *
10 * $Date: 2003/07/25 04:51:45 $
11 *
12 * $Id: StringToPrimitiveDoubleConverter.java,v 1.1.1.1 2003/07/25 04:51:45 takatsukam Exp $
13 *
14 * Reference: Document no:
15 * ___ ___
16 *
17 * To Do:
18 * ___
19 *
20 ------------------------------------------------------------------- */
21
22 /* --------------------------- Package ---------------------------- */
23 package net.jbeans.data.converter;
24
25 /* ------------------ Import classes (packages) ------------------- *//package-summary/html">color="#329900"> ------------------ Import classes (packages) ------------------- *//package-summary.html">color="#329900">/* ------------------ Import classes (packages) ------------------- *//package-summary.html">color="#329900"> ------------------ Import classes (packages) ------------------- */
26 import net.jbeans.data.*;
27
28 /*====================================================================
29 Implementation of class StringToPrimitiveDoubleConverter
30 ====================================================================*/
31 /***
32 * generally describe StringToPrimitiveDoubleConverter in here
33 *
34 * @version $Revision: 1.1.1.1 $
35 * @author Masahiro Takatsuka (masa@jbeans.net)
36 * @see DataConverter
37 */
38
39 public final class StringToPrimitiveDoubleConverter extends DataConverter {
40 /***
41 * Initializes acceptable soruce and target types.
42 */
43 protected void setDataTypes() {
44 this.sourceTypes = new Class[1];
45 this.sourceTypes[0] = java.lang.String.class;
46 this.targetTypes = new Class[1];
47 this.targetTypes[0] = Double.TYPE;
48 }
49
50 /***
51 * Converts the specified object "obj" into an object of a class "class1".
52 */
53 public final Object convert(Object obj, Class class1) throws InvalidDataTypeException, UnsupportedTypeException {
54 System.out.println("StringToPrimitiveDoubleConverter: emtpy method");
55 return null;
56 }
57
58 public final double convert(String obj, String className) throws InvalidDataTypeException, UnsupportedTypeException {
59 return Double.parseDouble(obj);
60 }
61 }
This page was automatically generated by Maven