Coverage details for net.sourceforge.demetrix.model.Task

LineHitsSource
1 /*******************************************************************************
2  * Demetrix process modelling system
3  *
4  * Copyright (c) 2003, 2004 Dimitri A. Pissarenko
5  *
6  * This file is part of Demetrix.
7  *
8  * Demetrix is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * Demetrix is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Demetrix; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  *
22  * For further information you may
23  *
24  * - send an e-mail in Russian, German or English to dimitri.pissarenko@gmx.net
25  * - look at http://sourceforge.net/projects/demetrix/
26  * - look at http://demetrix.sourceforge.net/
27  * - look at http://members.inode.at/d.pissarenko/
28  *
29  *****************************************************************************/
30 package net.sourceforge.demetrix.model;
31 import java.util.Enumeration;
32 import java.util.Iterator;
33 import org._3pq.jgrapht.Graph;
34 import net.sourceforge.demetrix.properties.DemetrixPropertiesHolder;
35 import net.sourceforge.demetrix.properties.DemetrixPropertiesStorage;
36 import net.sourceforge.demetrix.properties.DemetrixProperty;
37 import net.sourceforge.demetrix.properties.StringProperty;
38 /**
39  * @author Dimitri Pissarenko
40  *
41  */
42 public class Task implements ProcessChainNode, DemetrixPropertiesHolder {
43     private Graph subGraph;
44     protected DemetrixPropertiesStorage properties;
4557    public Task() {
4657        StringProperty nameProperty = null;
4757        properties = new DemetrixPropertiesStorage();
4857        nameProperty = new StringProperty();
4957        nameProperty.setName("name");
5057        nameProperty.setValue("task");
5157        this.addProperty(nameProperty);
5257    }
53     /* (non-Javadoc)
54      * @see net.sourceforge.demetrix.properties.DemetrixPropertiesHolder#addProperty(net.sourceforge.demetrix.properties.DemetrixProperty)
55      */
56     public void addProperty(DemetrixProperty property) {
5755        this.properties.addProperty(property);
5855    }
59     /* (non-Javadoc)
60      * @see net.sourceforge.demetrix.properties.DemetrixPropertiesHolder#getAllProperties()
61      */
62     public Iterator getAllProperties() {
6318        return this.properties.getAllProperties();
64     }
65     /* (non-Javadoc)
66      * @see net.sourceforge.demetrix.properties.DemetrixPropertiesHolder#getProperty(java.lang.String)
67      */
68     public DemetrixProperty getProperty(String name) {
69106        return this.properties.getProperty(name);
70     }
71     /* (non-Javadoc)
72      * @see java.lang.Object#toString()
73      */
74     public String toString() {
7536        StringProperty nameProperty = null;
7636        nameProperty = (StringProperty) this.getProperty("name");
7736        if (nameProperty != null) {
7836            return (String) nameProperty.getValue();
79         } else {
800            return "";
81         }
82     }
83     /* (non-Javadoc)
84      * @see net.sourceforge.demetrix.properties.DemetrixPropertiesHolder#getAllPropertyNames()
85      */
86     public Enumeration getAllPropertyNames() {
870        return this.properties.getAllPropertyNames();
88     }
89     /* (non-Javadoc)
90      * @see net.sourceforge.demetrix.properties.DemetrixPropertiesHolder#getPropertiesStorage()
91      */
92     public DemetrixPropertiesHolder getPropertiesStorage() {
93580        return this.properties;
94     }
95     /* (non-Javadoc)
96      * @see java.lang.Object#equals(java.lang.Object)
97      */
98     public boolean equals(Object anotherObject) {
99303        DemetrixPropertiesHolder demetrixPropertiesHolder = null;
100303        if (anotherObject == null) {
1011            return false;
102         }
103302        if (anotherObject instanceof DemetrixPropertiesHolder) {
104302            demetrixPropertiesHolder = (DemetrixPropertiesHolder) anotherObject;
105302            return this.getPropertiesStorage().equals(
106                 demetrixPropertiesHolder.getPropertiesStorage());
107         } else {
1080            return false;
109         }
110     }
111     /* (non-Javadoc)
112      * @see net.sourceforge.demetrix.model.ProcessChainNode#getSubGraph()
113      */
114     public Graph getSubGraph() {
11572        return this.subGraph;
116     }
117     /* (non-Javadoc)
118      * @see net.sourceforge.demetrix.model.ProcessChainNode#setSubGraph(org._3pq.jgrapht.graph.Subgraph)
119      */
120     public void setSubGraph(Graph subGraph) {
12120        this.subGraph = subGraph;
12220    }
123     /* (non-Javadoc)
124      * @see java.lang.Object#hashCode()
125      */
126     public int hashCode() {
127354        int hashCode = 0;
128354        if (this.subGraph != null) {
12948            hashCode += this.subGraph.hashCode();
130         }
131354        hashCode += this.properties.hashCode();
132354        return hashCode;
133     }
134 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.