You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by rd...@apache.org on 2012/05/20 20:43:28 UTC
svn commit: r1340797 -
/creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/LicenseAndOrganisationCollator.java
Author: rdonkin
Date: Sun May 20 18:43:27 2012
New Revision: 1340797
URL: http://svn.apache.org/viewvc?rev=1340797&view=rev
Log:
More documentation
Modified:
creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/LicenseAndOrganisationCollator.java
Modified: creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/LicenseAndOrganisationCollator.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/LicenseAndOrganisationCollator.java?rev=1340797&r1=1340796&r2=1340797&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/LicenseAndOrganisationCollator.java (original)
+++ creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/LicenseAndOrganisationCollator.java Sun May 20 18:43:27 2012
@@ -14,7 +14,7 @@
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
+ * under the License.
*/
package org.apache.creadur.whisker.model;
@@ -22,29 +22,34 @@ import java.util.Set;
import java.util.TreeSet;
/**
- * Collates
+ * Collates licenses and organisations.
*/
public class LicenseAndOrganisationCollator extends Visitor {
-
+ /** The licenses currently collected. */
private final Set<License> licenses = new TreeSet<License>();
+ /** The organisations currently collected. */
private final Set<Organisation> organisations = new TreeSet<Organisation>();
/**
- * @return the licenses
+ * Gets the licenses collected.
+ * @return not null
*/
public Set<License> getLicenses() {
return this.licenses;
}
/**
- * @return the organisation
+ * Gets the organisations collected.
+ * @return not null
*/
public Set<Organisation> getOrganisation() {
return this.organisations;
}
/**
- * @see org.apache.rat.whisker.legacy.out.Visitor#traverseResource()
+ * Don't traverse resources.
+ * @see Visitor#traverseResource()
+ * @return false
*/
@Override
public boolean traverseResource() {
@@ -52,19 +57,29 @@ public class LicenseAndOrganisationColla
}
/**
- * @see org.apache.rat.whisker.legacy.out.Visitor#visit(org.apache.rat.whisker.legacy.out.WithLicense)
+ * Visits {@link WithLicense}.
+ * @see Visitor#visit(WithLicense)
+ * @param license not null
*/
@Override
public void visit(final WithLicense license) {
this.licenses.add(license.getLicense());
}
+ /**
+ * Was this the only license collected?
+ * @param license not null
+ * @return true when the collection contains just this license,
+ * false when no licenses or any other licenses were collected
+ */
public boolean isOnlyLicense(final License license) {
return (this.licenses.size() == 1) && this.licenses.contains(license);
}
/**
- * @see org.apache.rat.whisker.legacy.out.Visitor#visit(org.apache.rat.whisker.legacy.out.ByOrganisation)
+ * Visits {@link ByOrganisation}.
+ * @see Visitor#visit(ByOrganisation)
+ * @param byOrganisation not null
*/
@Override
public void visit(final ByOrganisation byOrganisation) {
@@ -72,7 +87,9 @@ public class LicenseAndOrganisationColla
}
/**
+ * Something useful for logging.
* @see java.lang.Object#toString()
+ * @return something for logging
*/
@Override
public String toString() {
@@ -81,8 +98,10 @@ public class LicenseAndOrganisationColla
}
/**
- * @param primaryOrganisationId
- * @return
+ * Is there only one organisation collected with the given id?
+ * @param primaryOrganisationId not null
+ * @return true when only one organisation has been collected
+ * and it has the given id
*/
public boolean isOnlyOrganisation(final String primaryOrganisationId) {
return this.organisations.size() == 1