|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Operator | Line # 28 | 56 | 33 | 93.5% |
0.9347826
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
(103) | |||
Result | |||
0.7282609
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException04 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException04 | 1 PASS | |
0.7173913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException06 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException06 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm00 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm00 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm35 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm35 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm42 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm42 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm04 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm04 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm24 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm24 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm01 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm01 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm50 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm50 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm40 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm40 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm09 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm09 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AbstractParserTestCase.testAllTogether org.qedeq.kernel.bo.parser.AbstractParserTestCase.testAllTogether | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm05 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm05 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm14 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm14 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm29 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm29 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm33 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm33 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm47 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm47 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm30 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm30 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm08 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm08 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm18 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm18 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm34 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm34 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm46 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm46 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm09 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm09 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm41 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm41 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm45 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm45 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm28 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm28 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm32 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm32 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm39 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm39 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm15 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm15 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm48 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm48 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm37 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm37 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm36 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm36 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm38 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm38 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm02 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm02 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm43 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm43 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm05 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm05 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm44 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm44 | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AbstractParserTestCase.testAllTogether org.qedeq.kernel.bo.parser.AbstractParserTestCase.testAllTogether | 1 PASS | |
0.5543478
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm31 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm31 | 1 PASS | |
0.54347825
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm21 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm21 | 1 PASS | |
0.54347825
|
org.qedeq.kernel.bo.parser.OperatorTest.testToString org.qedeq.kernel.bo.parser.OperatorTest.testToString | 1 PASS | |
0.54347825
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm22 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm22 | 1 PASS | |
0.54347825
|
org.qedeq.kernel.bo.parser.AbstractParserTestCase.testAllTogether org.qedeq.kernel.bo.parser.AbstractParserTestCase.testAllTogether | 1 PASS | |
0.54347825
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm24 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm24 | 1 PASS | |
0.5326087
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm06 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm06 | 1 PASS | |
0.5326087
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm07 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm07 | 1 PASS | |
0.5217391
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm26 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm26 | 1 PASS | |
0.5217391
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm28 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm28 | 1 PASS | |
0.5217391
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm23 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm23 | 1 PASS | |
0.5217391
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm25 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm25 | 1 PASS | |
0.51086956
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm08 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm08 | 1 PASS | |
0.5
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm08 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm08 | 1 PASS | |
0.5
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm07 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm07 | 1 PASS | |
0.48913044
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm02 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm02 | 1 PASS | |
0.48913044
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm01 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm01 | 1 PASS | |
0.48913044
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException03 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException03 | 1 PASS | |
0.48913044
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm00 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm00 | 1 PASS | |
0.48913044
|
org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm03 org.qedeq.kernel.bo.parser.LatexMathParserTest.testReadMaximalTerm03 | 1 PASS | |
0.48913044
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException02 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException02 | 1 PASS | |
0.47826087
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm27 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm27 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm12 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm12 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm22 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm22 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm10 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm10 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm49 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm49 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm03 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm03 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm17 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm17 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm20 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm20 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm04 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm04 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm07 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm07 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm27 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm27 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm11 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm11 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException00 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException00 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm16 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm16 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm23 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm23 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm21 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm21 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm06 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm06 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm26 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm26 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm13 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm13 | 1 PASS | |
0.4673913
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm19 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testReadMaximalTerm19 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm16 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm16 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm03 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm03 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm12 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm12 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm20 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm20 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm15 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm15 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm18 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm18 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm13 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm13 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm05 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm05 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm17 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm17 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm09 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm09 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm00 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm00 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm01 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm01 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm04 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm04 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm10 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm10 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm19 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm19 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm14 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm14 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm02 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm02 | 1 PASS | |
0.45652175
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm11 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm11 | 1 PASS | |
0.42391303
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException01 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException01 | 1 PASS | |
0.42391303
|
org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException05 org.qedeq.kernel.bo.parser.AsciiMathParserTest.testException05 | 1 PASS | |
0.32608697
|
org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm06 org.qedeq.kernel.bo.parser.SimpleMathParserTest.testReadMaximalTerm06 | 1 PASS | |
0.08695652
|
org.qedeq.kernel.bo.parser.OperatorTest.testIsFix org.qedeq.kernel.bo.parser.OperatorTest.testIsFix | 1 PASS | |
0.02173913
|
org.qedeq.kernel.bo.parser.OperatorTest.testGetMin org.qedeq.kernel.bo.parser.OperatorTest.testGetMin | 1 PASS | |
0.02173913
|
org.qedeq.kernel.bo.parser.OperatorTest.testGetMax org.qedeq.kernel.bo.parser.OperatorTest.testGetMax | 1 PASS | |
1 | /* This file is part of the project "Hilbert II" - http://www.qedeq.org | |
2 | * | |
3 | * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>. | |
4 | * | |
5 | * "Hilbert II" is free software; you can redistribute | |
6 | * it and/or modify it under the terms of the GNU General Public | |
7 | * License as published by the Free Software Foundation; either | |
8 | * version 2 of the License, or (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | */ | |
15 | ||
16 | package org.qedeq.kernel.bo.parser; | |
17 | ||
18 | ||
19 | /** | |
20 | * This class describes an term or logical operator. An operator is of either | |
21 | * prefix, infix or postfix type and has a minimum and maximum number of operands. | |
22 | * It has a symbol or token that enables to recognize it and a QEDEQ representation. | |
23 | * Each instance of this class is unique so two instances with the same parameters are | |
24 | * different from each other. | |
25 | * | |
26 | * @author Michael Meyling | |
27 | */ | |
28 | public final class Operator { | |
29 | ||
30 | /** Marks infix operator. */ | |
31 | public static final int INFIX = 0; | |
32 | ||
33 | /** Marks prefix operator. */ | |
34 | public static final int SIMPLE_PREFIX = 1; | |
35 | ||
36 | /** Marks postfix operator. */ | |
37 | public static final int POSTFIX = 2; | |
38 | ||
39 | /** Marks function operator. */ | |
40 | public static final int FUNCTION = 4; | |
41 | ||
42 | /** Prefix, function, infix or postfix. See {@link #SIMPLE_PREFIX}, {@link #FUNCTION}, | |
43 | * {@link #INFIX} and {@link #POSTFIX}. */ | |
44 | private final int type; | |
45 | ||
46 | /** Start symbol or token for this operator. */ | |
47 | private final String startSymbol; | |
48 | ||
49 | /** Separator symbol or token for this operator. This could be a comma for example. */ | |
50 | private final String separatorSymbol; | |
51 | ||
52 | /** End symbol or token for this operator. */ | |
53 | private final String endSymbol; | |
54 | ||
55 | /** Operator priority. Highest is 0. */ | |
56 | private final int priority; | |
57 | ||
58 | /** QEDEQ token for this operator. */ | |
59 | private final String qedeq; | |
60 | ||
61 | /** First QEDEQ argument. Can be <code>null</code>. */ | |
62 | private final String qedeqArgument; | |
63 | ||
64 | /** Minimum number of arguments. */ | |
65 | private final int min; | |
66 | ||
67 | /** Maximum number of arguments. */ | |
68 | private final int max; | |
69 | ||
70 | ||
71 | /** | |
72 | * Constructor. | |
73 | * | |
74 | * @param symbol Symbol or token for this operator. | |
75 | * @param qedeq QEDEQ operator symbol. | |
76 | * @param qedeqArgument First Argument in QEDEQ-Syntax - if any. | |
77 | * @param priority Operator priority, highest is 0. | |
78 | * @param type Prefix, infix or postfix. See {@link #SIMPLE_PREFIX}, {@link #FUNCTION}, | |
79 | * {@link #INFIX} and {@link #POSTFIX}. | |
80 | * @param min Minimum number of arguments for this operator. | |
81 | */ | |
82 | 616 | public Operator(final String symbol, |
83 | final String qedeq, | |
84 | final String qedeqArgument, | |
85 | final int priority, | |
86 | final int type, | |
87 | final int min) { | |
88 | 616 | this(symbol, qedeq, qedeqArgument, priority, type, min, -1); |
89 | } | |
90 | ||
91 | /** | |
92 | * Constructor. | |
93 | * | |
94 | * @param symbol Symbol or token for this operator. | |
95 | * @param qedeq QEDEQ operator symbol. | |
96 | * @param qedeqArgument First Argument in QEDEQ-Syntax - if any. | |
97 | * @param priority Operator priority, highest is 0. | |
98 | * @param type Prefix, infix or postfix. See {@link #SIMPLE_PREFIX}, | |
99 | * {@link #FUNCTION}, | |
100 | * {@link #INFIX} and {@link #POSTFIX}. | |
101 | * @param min Minimum number of arguments for this operator. | |
102 | * @param max Maximum number of arguments for this operator. | |
103 | */ | |
104 | 1599 | public Operator(final String symbol, |
105 | final String qedeq, | |
106 | final String qedeqArgument, | |
107 | final int priority, | |
108 | final int type, | |
109 | final int min, | |
110 | final int max) { | |
111 | 1599 | this(symbol, null, null, qedeq, qedeqArgument, priority, type, min, max); |
112 | } | |
113 | ||
114 | /** | |
115 | * Constructor for prefix operators like <code>{x | x > 0}</code>. | |
116 | * | |
117 | * @param startSymbol Starting symbol or token for this operator. | |
118 | * @param separatorSymbol Symbol or token that separates arguments for this operator. | |
119 | * @param endSymbol End symbol or token for this operator. | |
120 | * @param qedeq QEDEQ operator symbol. | |
121 | * @param qedeqArgument First Argument in QEDEQ-Syntax - if any | |
122 | * @param priority Operator priority, highest is 0. | |
123 | * @param min Minimum number of arguments for this operator. | |
124 | */ | |
125 | 104 | public Operator(final String startSymbol, |
126 | final String separatorSymbol, | |
127 | final String endSymbol, | |
128 | final String qedeq, | |
129 | final String qedeqArgument, | |
130 | final int priority, | |
131 | final int min) { | |
132 | 104 | this(startSymbol, separatorSymbol, endSymbol, qedeq, qedeqArgument, priority, SIMPLE_PREFIX, |
133 | min, -1); | |
134 | } | |
135 | ||
136 | /** | |
137 | * Constructor for prefix operators like <code>{x, y, z}</code>. | |
138 | * | |
139 | * @param startSymbol Starting symbol or token for this operator. | |
140 | * @param separatorSymbol Symbol or token that separates arguments for this operator. | |
141 | * @param endSymbol End symbol or token for this operator. | |
142 | * @param qedeq QEDEQ operator symbol. | |
143 | * @param qedeqArgument First Argument in QEDEQ-Syntax - if any. | |
144 | * @param priority Operator priority, highest is 0. | |
145 | * @param min Minimum number of arguments for this operator. | |
146 | * @param max Maximum number of arguments for this operator. | |
147 | */ | |
148 | 104 | public Operator(final String startSymbol, |
149 | final String separatorSymbol, | |
150 | final String endSymbol, | |
151 | final String qedeq, | |
152 | final String qedeqArgument, | |
153 | final int priority, | |
154 | final int min, | |
155 | final int max) { | |
156 | 104 | this(startSymbol, separatorSymbol, endSymbol, qedeq, qedeqArgument, priority, SIMPLE_PREFIX, |
157 | min, max); | |
158 | } | |
159 | ||
160 | /** | |
161 | * Constructor. | |
162 | * | |
163 | * @param startSymbol Starting symbol or token for this operator. | |
164 | * @param separatorSymbol Symbol or token that separates arguments for this operator. | |
165 | * @param endSymbol End symbol or token for this operator. | |
166 | * @param qedeq QEDEQ operator symbol. | |
167 | * @param qedeqArgument First Argument in QEDEQ-Syntax - if any. | |
168 | * @param priority Operator priority, highest is 0. | |
169 | * @param type Prefix, infix or postfix. See {@link #SIMPLE_PREFIX}, | |
170 | * {@link #FUNCTION}, {@link #INFIX} and {@link #POSTFIX}. | |
171 | * @param min Minimum number of arguments for this operator. | |
172 | * @param max Maximum number of arguments for this operator. | |
173 | */ | |
174 | 1807 | public Operator(final String startSymbol, final String separatorSymbol, final String endSymbol, |
175 | final String qedeq, | |
176 | final String qedeqArgument, | |
177 | final int priority, | |
178 | final int type, | |
179 | final int min, | |
180 | final int max) { | |
181 | 1807 | this.startSymbol = startSymbol; |
182 | 1807 | this.separatorSymbol = separatorSymbol; |
183 | 1807 | this.endSymbol = endSymbol; |
184 | 1807 | this.type = type; |
185 | 1807 | this.qedeq = qedeq; |
186 | 1807 | this.qedeqArgument = qedeqArgument; |
187 | 1807 | this.priority = priority; |
188 | 1807 | this.min = min; |
189 | 1807 | this.max = max; |
190 | 1807 | switch (type) { |
191 | 843 | case INFIX: |
192 | 783 | case SIMPLE_PREFIX: |
193 | 161 | case FUNCTION: |
194 | 20 | case POSTFIX: |
195 | 1807 | break; |
196 | 0 | default: |
197 | 0 | throw new IllegalArgumentException("unknown operator type: " |
198 | + type); | |
199 | } | |
200 | 1807 | if (max != -1 && min > max) { |
201 | 0 | throw new IllegalArgumentException("Min greater than max: " + min + " > " + max); |
202 | } | |
203 | 1807 | if (isInfix() && min < 2) { |
204 | 0 | throw new IllegalArgumentException("Infix needs at least two arguments"); |
205 | } | |
206 | } | |
207 | ||
208 | /** | |
209 | * Returns symbol or token to identify this operator. | |
210 | * | |
211 | * @return Symbol or token to identify a start of this operator. | |
212 | */ | |
213 | 153406 | public final String getStartSymbol() { |
214 | 153406 | return startSymbol; |
215 | } | |
216 | ||
217 | /** | |
218 | * Returns symbol or token to separate different arguments for this operator. Can only be | |
219 | * different from <code>null</code> if this is a prefix operator. | |
220 | * | |
221 | * @return Symbol or token to identify the start of a new argument of this operator. | |
222 | */ | |
223 | 310 | public String getSeparatorSymbol() { |
224 | 310 | return separatorSymbol; |
225 | } | |
226 | ||
227 | /** | |
228 | * Returns symbol or token to identify the end of this operator. Can only be different from | |
229 | * <code>null</code> if this is a prefix operator. | |
230 | * | |
231 | * @return Symbol or token to identify the end of this operator. Maybe <code>null</code>. | |
232 | */ | |
233 | 590 | public String getEndSymbol() { |
234 | 590 | return endSymbol; |
235 | } | |
236 | ||
237 | /** | |
238 | * Is this an infix operator? | |
239 | * | |
240 | * @return Is this an infix operator? | |
241 | */ | |
242 | 1819 | public final boolean isInfix() { |
243 | 1819 | return type == INFIX; |
244 | } | |
245 | ||
246 | /** | |
247 | * Is this a prefix operator? | |
248 | * | |
249 | * @return Is this a prefix operator? | |
250 | */ | |
251 | 1127 | public final boolean isPrefix() { |
252 | 1127 | return type == SIMPLE_PREFIX || type == FUNCTION; |
253 | } | |
254 | ||
255 | /** | |
256 | * Is this a function operator? | |
257 | * | |
258 | * @return Is this a function operator? | |
259 | */ | |
260 | 455 | public final boolean isFunction() { |
261 | 455 | return type == FUNCTION; |
262 | } | |
263 | ||
264 | /** | |
265 | * Is this a postfix operator? | |
266 | * | |
267 | * @return Is this a postfix operator? | |
268 | */ | |
269 | 627 | public final boolean isPostfix() { |
270 | 627 | return type == POSTFIX; |
271 | } | |
272 | ||
273 | /** | |
274 | * Get operator priority. 0 is the highest priority. | |
275 | * | |
276 | * @return Priority. | |
277 | */ | |
278 | 2379 | public final int getPriority() { |
279 | 2379 | return this.priority; |
280 | } | |
281 | ||
282 | /** | |
283 | * Get minimum argument number. | |
284 | * | |
285 | * @return Minimum argument number. | |
286 | */ | |
287 | 873 | public final int getMin() { |
288 | 873 | return this.min; |
289 | } | |
290 | ||
291 | /** | |
292 | * Get maximum argument number. | |
293 | * | |
294 | * @return Maximum argument number. | |
295 | */ | |
296 | 3542 | public final int getMax() { |
297 | 3542 | return max; |
298 | } | |
299 | ||
300 | /** | |
301 | * Get QEDEQ operator name. | |
302 | * | |
303 | * @return QEDEQ operator name. | |
304 | */ | |
305 | 11349 | public final String getQedeq() { |
306 | 11349 | return qedeq; |
307 | } | |
308 | ||
309 | /** | |
310 | * Get first QEDEQ argument. | |
311 | * | |
312 | * @return First QEDEQ argument. Can be <code>null</code>. | |
313 | */ | |
314 | 18100 | public final String getQedeqArgument() { |
315 | 18100 | return qedeqArgument; |
316 | } | |
317 | ||
318 | 8 | public final String toString() { |
319 | 8 | final StringBuffer buffer = new StringBuffer(getStartSymbol()); |
320 | 8 | buffer.append("[" + getMin() + ", "); |
321 | 8 | if (getMax() == -1) { |
322 | 4 | buffer.append(".."); |
323 | } else { | |
324 | 4 | buffer.append(getMax()); |
325 | } | |
326 | 8 | buffer.append("]"); |
327 | 8 | if (getSeparatorSymbol() != null) { |
328 | 2 | buffer.append(" ").append(getSeparatorSymbol()); |
329 | } | |
330 | 8 | if (getEndSymbol() != null) { |
331 | 2 | buffer.append(" ").append(getEndSymbol()); |
332 | } | |
333 | 8 | if (isFunction()) { |
334 | 1 | buffer.append(", is function"); |
335 | } | |
336 | 8 | if (isPrefix()) { |
337 | 4 | buffer.append(", is prefix"); |
338 | } | |
339 | 8 | if (isInfix()) { |
340 | 3 | buffer.append(", is infix"); |
341 | } | |
342 | 8 | if (isPostfix()) { |
343 | 1 | buffer.append(", is postfix"); |
344 | } | |
345 | 8 | return buffer.toString(); |
346 | } | |
347 | ||
348 | } | |
349 |
|