Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
11   95   9   1.57
6   33   0.82   7
7     1.29  
1    
 
  LocationVo       Line # 31 11 9 100% 1.0
 
  (58)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2010, 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.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.base.module.Location;
20   
21   
22    /**
23    * Describes the "physical" directory location for a module.
24    * This is a full or relative URL like:
25    * <code>http://www.qedeq.org/principia/0_01_06/</code> or <code>.</code>
26    * or <code>file:///qedeq/</code>
27    *
28    * @version $Revision: 1.8 $
29    * @author Michael Meyling
30    */
 
31    public class LocationVo implements Location {
32   
33    /** URL to "physical" directory location of module. */
34    private String location;
35   
36   
37    /**
38    * Constructs a location description for a module. The <code>location</code>
39    * parameter contains an URL that points to a directory.
40    * This is a full or relative URL like:
41    * <code>http://www.qedeq.org/principia/0_01_06/</code> or <code>.</code>
42    * or <code>file:///qedeq/</code>
43    * Here it is not tested that it is a formal correct URL.
44    *
45    * @param location URL directory location.
46    */
 
47  439 toggle public LocationVo(final String location) {
48  439 this.location = location;
49    }
50   
51    /**
52    * Constructs an empty location description for a module.
53    */
 
54  545 toggle public LocationVo() {
55    // nothing to do
56    }
57   
58    /**
59    * Set URL to "physical" directory location of module. The <code>location</code>
60    * parameter contains an URL that points to a directory.
61    * This is a full or relative URL like:
62    * <code>http://www.qedeq.org/principia/0_01_06/</code> or <code>.</code>
63    * or <code>file:///qedeq/</code>
64    * Here it is not tested that it is a formal correct URL.
65    *
66    * @param location URL directory location.
67    */
 
68  537 toggle public final void setLocation(final String location) {
69  537 this.location = location;
70    }
71   
 
72  2789 toggle public final String getLocation() {
73  2789 return location;
74    }
75   
 
76  282 toggle public boolean equals(final Object obj) {
77  282 if (!(obj instanceof LocationVo)) {
78  4 return false;
79    }
80  278 final LocationVo other = (LocationVo) obj;
81  278 return EqualsUtility.equals(getLocation(), other.getLocation());
82    }
83   
 
84  375 toggle public int hashCode() {
85  375 return (getLocation() != null ? getLocation().hashCode() : 0);
86    }
87   
 
88  246 toggle public String toString() {
89  246 if (getLocation() == null) {
90  12 return "";
91    }
92  234 return getLocation();
93    }
94   
95    }