PageRenderTime 63ms CodeModel.GetById 54ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/farmR/src/java/src/jfm/xml/VARRiskParser.java

https://code.google.com/p/javawfm/
Java | 64 lines | 31 code | 6 blank | 27 comment | 0 complexity | 98b3c9855eb3579bfaa81c353ebbca97 MD5 | raw file
 1/**
 2 * 
 3 */
 4package jfm.xml;
 5
 6/**
 7 * @author iracooke
 8 *
 9 */
10public class VARRiskParser extends JFMObjectParser {
11	VARRiskParser(ObjectParser parent_){
12		parent=parent_;
13		this.registerAttribute("alpha", mandatoryAttribute);
14		this.registerAttribute("offset",mandatoryAttribute);
15	}
16	/* (non-Javadoc)
17	 * @see jfm.xml.ObjectParser#initializeObject()
18	 */
19	@Override
20	public void initializeObject() throws XMLObjectException,
21			XMLSyntaxException {
22		// TODO Auto-generated method stub
23		double alpha = Double.parseDouble(this.getNamedAttribute("alpha"));
24		double offset = Double.parseDouble(this.getNamedAttribute("offset"));
25		obj=new jfm.model.VARRiskComponent(alpha,offset);
26	}
27
28	/* (non-Javadoc)
29	 * @see jfm.xml.ObjectParser#isPrimitive()
30	 */
31	@Override
32	protected boolean isPrimitive() {
33		// TODO Auto-generated method stub
34		return false;
35	}
36
37	/* (non-Javadoc)
38	 * @see jfm.xml.ObjectParser#name()
39	 */
40	@Override
41	public String name() {
42		// TODO Auto-generated method stub
43		return "VARRisk";
44	}
45
46	/* (non-Javadoc)
47	 * @see jfm.xml.ObjectParser#parsesNode()
48	 */
49	@Override
50	public String parsesNode() {
51		// TODO Auto-generated method stub
52		return "varrisk";
53	}
54
55	/* (non-Javadoc)
56	 * @see jfm.xml.ObjectParser#toString()
57	 */
58	@Override
59	public String toString() {
60		// TODO Auto-generated method stub
61		return "VAR Risk";
62	}
63
64}