EMMA Coverage Report (generated Fri Feb 14 08:28:31 UTC 2014)
[all classes][org.qedeq.kernel.xml.handler.module]

COVERAGE SUMMARY FOR SOURCE FILE [ExistentialHandler.java]

nameclass, %method, %block, %line, %
ExistentialHandler.java100% (1/1)100% (5/5)92%  (73/79)90%  (18/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ExistentialHandler100% (1/1)100% (5/5)92%  (73/79)90%  (18/20)
startElement (String, SimpleAttributes): void 100% (1/1)88%  (23/26)83%  (5/6)
endElement (String): void 100% (1/1)90%  (26/29)83%  (5/6)
ExistentialHandler (AbstractSimpleHandler): void 100% (1/1)100% (11/11)100% (3/3)
getExistentialVo (): Existential 100% (1/1)100% (3/3)100% (1/1)
init (): void 100% (1/1)100% (10/10)100% (4/4)

1/* This file is part of the project "Hilbert II" - http://www.qedeq.org
2 *
3 * Copyright 2000-2014,  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 
16package org.qedeq.kernel.xml.handler.module;
17 
18import org.qedeq.kernel.se.base.list.Element;
19import org.qedeq.kernel.se.base.module.Existential;
20import org.qedeq.kernel.se.dto.module.ExistentialVo;
21import org.qedeq.kernel.xml.common.XmlSyntaxException;
22import org.qedeq.kernel.xml.handler.common.AbstractSimpleHandler;
23import org.qedeq.kernel.xml.handler.common.SimpleAttributes;
24import org.qedeq.kernel.xml.handler.list.ElementHandler;
25 
26 
27/**
28 * Parse a existential generalization rule usage.
29 *
30 * @author  Michael Meyling
31 */
32public class ExistentialHandler extends AbstractSimpleHandler {
33 
34    /** Rule value object. */
35    private Existential existential;
36 
37    /** Reference to previously proved formula. */
38    private String ref;
39 
40    /** Subject variable. */
41    private Element subjectVariable;
42 
43    /** Handle elements. */
44    private final ElementHandler elementHandler;
45 
46    /**
47     * Deals with definitions.
48     *
49     * @param   handler Parent handler.
50     */
51    public ExistentialHandler(final AbstractSimpleHandler handler) {
52        super(handler, "EXISTENTIAL");
53        elementHandler = new ElementHandler(this);
54    }
55 
56    public final void init() {
57        existential = null;
58        subjectVariable = null;
59        ref = null;
60    }
61 
62    /**
63     * Get Substitute Predicate Variable Rule usage.
64     *
65     * @return  Substitute Predicate Variable usage.
66     */
67    public final Existential getExistentialVo() {
68        return existential;
69    }
70 
71    public final void startElement(final String name, final SimpleAttributes attributes)
72            throws XmlSyntaxException {
73        if (getStartTag().equals(name)) {
74            ref = attributes.getString("ref");
75        } else if ("VAR".equals(name)) {
76            changeHandler(elementHandler, name, attributes);
77        } else {
78            throw XmlSyntaxException.createUnexpectedTagException(name);
79        }
80    }
81 
82    public final void endElement(final String name) throws XmlSyntaxException {
83        if (getStartTag().equals(name)) {
84            existential = new ExistentialVo(ref, subjectVariable);
85        } else if ("VAR".equals(name)) {
86            subjectVariable = elementHandler.getElement();
87        } else {
88            throw XmlSyntaxException.createUnexpectedTagException(name);
89        }
90    }
91 
92}

[all classes][org.qedeq.kernel.xml.handler.module]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov