Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../img/srcFileCovDistChart8.png 47% of files have more coverage
12   131   9   1,33
0   37   0,75   9
9     1  
1    
 
  ModuleContext       Line # 36 12 9 71,4% 0.71428573
 
  (37)
 
1    /* $Id: ModuleContext.java,v 1.2 2008/07/26 07:59:40 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
6    *
7    * "Hilbert II" is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public
9    * License as published by the Free Software Foundation; either
10    * version 2 of the License, or (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    * GNU General Public License for more details.
16    */
17   
18    package org.qedeq.kernel.common;
19   
20    import org.qedeq.base.trace.Trace;
21   
22   
23    /**
24    * Define context for an instance of {@link org.qedeq.kernel.base.module.Qedeq}.
25    * It consists of a location information: where is this module located.
26    * Also the location within the {@link org.qedeq.kernel.base.module.Qedeq} object
27    * should be described in an XPath like manner.
28    * <p>
29    * The idea behind this context is a caller perspective. The caller sets the
30    * context (at least the module location information) and if the called method
31    * throws an exception a try/catch block can retrieve the context information.
32    *
33    * @version $Revision: 1.2 $
34    * @author Michael Meyling
35    */
 
36    public class ModuleContext {
37   
38    /** This class. */
39    private static final Class CLASS = ModuleContext.class;
40   
41    /** Module location. */
42    private ModuleAddress moduleLocation;
43   
44    /** Location within the module. */
45    private String locationWithinModule;
46   
47    /**
48    * Constructor.
49    *
50    * @param moduleLocation Module location information.
51    * @param locationWithinModule Location within module.
52    */
 
53  68910 toggle public ModuleContext(final ModuleAddress moduleLocation, final String locationWithinModule) {
54  68910 this.moduleLocation = moduleLocation;
55  68910 this.locationWithinModule = locationWithinModule;
56    }
57   
58    /**
59    * Constructor.
60    *
61    * @param moduleLocation Module location information.
62    */
 
63  33080 toggle public ModuleContext(final ModuleAddress moduleLocation) {
64  33080 this(moduleLocation, "");
65    }
66   
67    /**
68    * Copy constructor.
69    *
70    * @param original Original context.
71    */
 
72  35674 toggle public ModuleContext(final ModuleContext original) {
73  35674 this(original.getModuleLocation(), original.getLocationWithinModule());
74    }
75   
76    /**
77    * Constructor.
78    *
79    * @param main Main context.
80    * @param moduleLocation Module location information.
81    */
 
82  0 toggle public ModuleContext(final ModuleContext main, final String moduleLocation) {
83  0 this(main.getModuleLocation(), moduleLocation);
84    }
85   
86    /**
87    * Get location information about module.
88    *
89    * @return Module location information.
90    */
 
91  118278 toggle public final ModuleAddress getModuleLocation() {
92  118278 return moduleLocation;
93    }
94   
95    /**
96    * Set location information about module.
97    *
98    * @param moduleLocation Module location information.
99    */
 
100  0 toggle public final void setModuleLocation(final ModuleAddress moduleLocation) {
101  0 this.moduleLocation = moduleLocation;
102    }
103   
104    /**
105    * Get location information where are we within the module.
106    *
107    * @return Location within module.
108    */
 
109  8261544 toggle public final String getLocationWithinModule() {
110  8261544 return locationWithinModule;
111    }
112   
113    /**
114    * Set location information where are we within the module.
115    *
116    * @param locationWithinModule Location within module.
117    */
 
118  6059746 toggle public final void setLocationWithinModule(final String locationWithinModule) {
119  6059746 final String method = "setLocationWithinModule(String)";
120  6059746 this.locationWithinModule = locationWithinModule;
121  6059746 Trace.param(CLASS, this, method, "locationWithinModule", locationWithinModule);
122    }
123   
124    /* (non-Javadoc)
125    * @see java.lang.Object#toString()
126    */
 
127  0 toggle public final String toString() {
128  0 return getModuleLocation() + ":" + getLocationWithinModule();
129    }
130   
131    }