View Javadoc

1   /*
2    * @(#)$Id: JdomBatchForValue.java 689 2009-07-22 00:10:27Z bsigner $
3    *
4    * Author		:	Ueli Kurmann, igesture@uelikurmann.ch
5    *                  
6    *
7    * Purpose		: 
8    *
9    * -----------------------------------------------------------------------
10   *
11   * Revision Information:
12   *
13   * Date				Who			Reason
14   *
15   * 15.10.2008		ukurmann	Initial Release
16   *
17   * -----------------------------------------------------------------------
18   *
19   * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
20   *
21   * This software is the proprietary information of ETH Zurich.
22   * Use is subject to license terms.
23   * 
24   */
25  
26  
27  package org.ximtec.igesture.batch.core.jdom;
28  
29  import org.jdom.Element;
30  import org.ximtec.igesture.batch.core.BatchForValue;
31  
32  
33  /**
34   * Comment
35   * @version 1.0 15.10.2008
36   * @author Ueli Kurmann
37   */
38  public class JdomBatchForValue {
39  
40     public static String ROOT_TAG = "for";
41  
42     public static String ATTRIBUTE_START = "start";
43  
44     public static String ATTRIBUTE_END = "end";
45  
46     public static String ATTRIBUTE_STEP = "step";
47  
48  
49     public static BatchForValue unmarshal(Element parameter) {
50        final BatchForValue value = new BatchForValue();
51        value.setStart(Double.parseDouble(parameter
52              .getAttributeValue(ATTRIBUTE_START)));
53        value.setEnd(Double
54              .parseDouble(parameter.getAttributeValue(ATTRIBUTE_END)));
55        value.setStep(Double.parseDouble(parameter
56              .getAttributeValue(ATTRIBUTE_STEP)));
57        return value;
58     } // unmarshal
59  
60  }