Skip to content

Commit

Permalink
JavaDoc improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Apr 6, 2017
1 parent 8b6e691 commit 1c4927e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions src/main/java/ch/poole/openinghoursparser/Rule.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,19 @@ public int hashCode() {
/**
* Returns true if the input only differs in the days and times objects
* Current considers comments significant
* @param o
* @return
* @param r rule to test against
* @return true if r can be merged with this rule
*/
public boolean isMergeableWith(Rule o) {
if (this == o) {
public boolean isMergeableWith(Rule r) {
if (this == r) {
return true;
}
if (!twentyfourseven
&& (comment == o.comment || (comment != null && comment.equals(o.comment)))
&& (years == o.years || (years != null && years.equals(o.years)))
&& (weeks == o.weeks || (weeks != null && weeks.equals(o.weeks)))
&& (monthdays == o.monthdays || (monthdays != null && monthdays.equals(o.monthdays)))
&& (modifier == o.modifier || (modifier != null && modifier.equals(o.modifier)))){
&& (comment == r.comment || (comment != null && comment.equals(r.comment)))
&& (years == r.years || (years != null && years.equals(r.years)))
&& (weeks == r.weeks || (weeks != null && weeks.equals(r.weeks)))
&& (monthdays == r.monthdays || (monthdays != null && monthdays.equals(r.monthdays)))
&& (modifier == r.modifier || (modifier != null && modifier.equals(r.modifier)))){
return true;
}
return false;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/ch/poole/openinghoursparser/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ private Util() {

/**
* find rules that only differs in the days and times objects and can be merged for display puposes
* @param rules
* @return
* @param rules rules to check
* @return list of list of rules that can be merged
*/
public static List<ArrayList<Rule>> getMergeableRules(List<Rule> rules) {

Expand Down Expand Up @@ -64,8 +64,8 @@ public static List<ArrayList<Rule>> getMergeableRules(List<Rule> rules) {

/**
* Generate an OH string from rules
* @param rules
* @return
* @param rules rules to convert to an opening_hours string
* @return specification conformant opening_hours string
*/
public static String rulesToOpeningHoursString(List<Rule> rules) {
StringBuilder result = new StringBuilder();
Expand All @@ -91,8 +91,8 @@ public static String rulesToOpeningHoursString(List<Rule> rules) {

/**
* Capitalize a string
* @param s
* @return
* @param s string to capitalize
* @return capitalized string
*/
public static String capitalize(String s) {
char[] c = s.toLowerCase(Locale.US).toCharArray();
Expand Down

0 comments on commit 1c4927e

Please sign in to comment.