"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/net/sourceforge/plantuml/project3/VerbIsOff.java" between
plantuml-1.2019.11.tar.gz and plantuml-1.2019.12.tar.gz

About: PlantUML is a tool (written in Java) to draw UML diagrams, using a simple and human readable text description. Sources.

VerbIsOff.java  (plantuml-1.2019.11):VerbIsOff.java  (plantuml-1.2019.12)
skipping to change at line 45 skipping to change at line 45
*/ */
package net.sourceforge.plantuml.project3; package net.sourceforge.plantuml.project3;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.command.regex.RegexResult;
public class VerbIsOff implements VerbPattern { public class VerbIsOff implements VerbPattern {
public Collection<ComplementPattern> getComplements() { public Collection<ComplementPattern> getComplements() {
return Arrays.<ComplementPattern> asList(new ComplementDate(), ne return Arrays
w ComplementDates()); .<ComplementPattern> asList(new ComplementDate(),
new ComplementDates(), new ComplementDayOfWeek());
} }
public IRegex toRegex() { public IRegex toRegex() {
return new RegexConcat(new RegexLeaf("is"), // return new RegexConcat(new RegexLeaf("is"), //
RegexLeaf.spaceOneOrMore(), // RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("off"), // new RegexLeaf("off"), //
RegexLeaf.spaceOneOrMore(), // RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("on")); new RegexOr(//
new RegexLeaf("on"),//
new RegexLeaf("for"),//
new RegexLeaf("the"),//
new RegexLeaf("at") //
));
} }
public Verb getVerb(final GanttDiagram project, RegexResult arg) { public Verb getVerb(final GanttDiagram project, RegexResult arg) {
return new Verb() { return new Verb() {
public CommandExecutionResult execute(Subject subject, Co mplement complement) { public CommandExecutionResult execute(Subject subject, Co mplement complement) {
final Resource resource = (Resource) subject; final Resource resource = (Resource) subject;
if (complement instanceof DaysAsDates) { if (complement instanceof DayOfWeek) {
resource.addCloseDay(((DayOfWeek) complem
ent));
} else if (complement instanceof DaysAsDates) {
for (DayAsDate when : (DaysAsDates) compl ement) { for (DayAsDate when : (DaysAsDates) compl ement) {
resource.addCloseDay(project.conv ert(when)); resource.addCloseDay(project.conv ert(when));
} }
} else { } else {
final DayAsDate when = (DayAsDate) comple ment; final DayAsDate when = (DayAsDate) comple ment;
resource.addCloseDay(project.convert(when )); resource.addCloseDay(project.convert(when ));
} }
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
}; };
} }
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)