MtasFunctionParserItem.java.html
7.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>MtasFunctionParserItem.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">MTAS</a> > <a href="index.source.html" class="el_package">mtas.parser.function.util</a> > <span class="el_source">MtasFunctionParserItem.java</span></div><h1>MtasFunctionParserItem.java</h1><pre class="source lang-java linenums">package mtas.parser.function.util;
import mtas.parser.function.ParseException;
/**
* The Class MtasFunctionParserItem.
*/
public class MtasFunctionParserItem {
/** The type. */
<span class="fc" id="L11"> private String type = null;</span>
/** The id. */
<span class="fc" id="L14"> private Integer id = null;</span>
/** The value long. */
<span class="fc" id="L17"> private Long valueLong = null;</span>
/** The value double. */
<span class="fc" id="L20"> private Double valueDouble = null;</span>
/** The degree. */
<span class="fc" id="L23"> private Integer degree = null;</span>
/** The parser. */
<span class="fc" id="L26"> private MtasFunctionParserFunction parser = null;</span>
/** The Constant TYPE_CONSTANT_LONG. */
public static final String TYPE_CONSTANT_LONG = "constantLong";
/** The Constant TYPE_CONSTANT_DOUBLE. */
public static final String TYPE_CONSTANT_DOUBLE = "constantDouble";
/** The Constant TYPE_PARSER_LONG. */
public static final String TYPE_PARSER_LONG = "parserLong";
/** The Constant TYPE_PARSER_DOUBLE. */
public static final String TYPE_PARSER_DOUBLE = "parserDouble";
/** The Constant TYPE_ARGUMENT. */
public static final String TYPE_ARGUMENT = "argument";
/** The Constant TYPE_N. */
public static final String TYPE_N = "n";
/**
* Instantiates a new mtas function parser item.
*
* @param t the t
* @throws ParseException the parse exception
*/
<span class="fc" id="L52"> public MtasFunctionParserItem(String t) throws ParseException {</span>
<span class="pc bpc" id="L53" title="1 of 2 branches missed."> if (t.equals(TYPE_N)) {</span>
<span class="fc" id="L54"> type = t;</span>
<span class="fc" id="L55"> degree = 0;</span>
} else {
<span class="nc" id="L57"> throw new ParseException("unknown type " + t);</span>
}
<span class="fc" id="L59"> }</span>
/**
* Instantiates a new mtas function parser item.
*
* @param t the t
* @param i the i
* @throws ParseException the parse exception
*/
<span class="fc" id="L68"> public MtasFunctionParserItem(String t, int i) throws ParseException {</span>
<span class="pc bpc" id="L69" title="1 of 2 branches missed."> if (t.equals(TYPE_ARGUMENT)) {</span>
<span class="fc" id="L70"> type = t;</span>
<span class="fc" id="L71"> id = i;</span>
<span class="fc" id="L72"> degree = 1;</span>
} else {
<span class="nc" id="L74"> throw new ParseException("unknown type " + t);</span>
}
<span class="fc" id="L76"> }</span>
/**
* Instantiates a new mtas function parser item.
*
* @param t the t
* @param l the l
* @throws ParseException the parse exception
*/
<span class="fc" id="L85"> public MtasFunctionParserItem(String t, long l) throws ParseException {</span>
<span class="pc bpc" id="L86" title="1 of 2 branches missed."> if (t.equals(TYPE_CONSTANT_LONG)) {</span>
<span class="fc" id="L87"> type = t;</span>
<span class="fc" id="L88"> valueLong = l;</span>
<span class="fc" id="L89"> degree = 0;</span>
} else {
<span class="nc" id="L91"> throw new ParseException("unknown type " + t);</span>
}
<span class="fc" id="L93"> }</span>
/**
* Instantiates a new mtas function parser item.
*
* @param t the t
* @param d the d
* @throws ParseException the parse exception
*/
<span class="fc" id="L102"> public MtasFunctionParserItem(String t, double d) throws ParseException {</span>
<span class="pc bpc" id="L103" title="1 of 2 branches missed."> if (t.equals(TYPE_CONSTANT_DOUBLE)) {</span>
<span class="fc" id="L104"> type = t;</span>
<span class="fc" id="L105"> valueDouble = d;</span>
<span class="fc" id="L106"> degree = 0;</span>
} else {
<span class="nc" id="L108"> throw new ParseException("unknown type " + t);</span>
}
<span class="fc" id="L110"> }</span>
/**
* Instantiates a new mtas function parser item.
*
* @param t the t
* @param p the p
* @throws ParseException the parse exception
*/
public MtasFunctionParserItem(String t, MtasFunctionParserFunction p)
<span class="fc" id="L120"> throws ParseException {</span>
<span class="fc bfc" id="L121" title="All 2 branches covered."> if (t.equals(TYPE_PARSER_LONG)) {</span>
<span class="fc" id="L122"> type = t;</span>
<span class="fc" id="L123"> parser = p;</span>
<span class="fc" id="L124"> degree = parser.degree;</span>
<span class="pc bpc" id="L125" title="1 of 2 branches missed."> } else if (t.equals(TYPE_PARSER_DOUBLE)) {</span>
<span class="fc" id="L126"> type = t;</span>
<span class="fc" id="L127"> parser = p;</span>
<span class="fc" id="L128"> degree = parser.degree;</span>
} else {
<span class="nc" id="L130"> throw new ParseException("unknown type " + t);</span>
}
<span class="fc" id="L132"> }</span>
/**
* Gets the type.
*
* @return the type
*/
public String getType() {
<span class="fc" id="L140"> return type;</span>
}
/**
* Gets the id.
*
* @return the id
*/
public int getId() {
<span class="fc" id="L149"> return id.intValue();</span>
}
/**
* Gets the degree.
*
* @return the degree
*/
public Integer getDegree() {
<span class="fc" id="L158"> return degree;</span>
}
/**
* Gets the value long.
*
* @return the value long
*/
public long getValueLong() {
<span class="fc" id="L167"> return valueLong.longValue();</span>
}
/**
* Gets the value double.
*
* @return the value double
*/
public double getValueDouble() {
<span class="fc" id="L176"> return valueDouble.doubleValue();</span>
}
/**
* Gets the parser.
*
* @return the parser
*/
public MtasFunctionParserFunction getParser() {
<span class="fc" id="L185"> return parser;</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html>