-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added three basic conditional algorithms to compare integers, refs #23
- Loading branch information
1 parent
c297e91
commit 90952ba
Showing
4 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
richwps/src/main/java/net/disy/wps/richwps/process/conditional/CIntEqInt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package net.disy.wps.richwps.process.conditional; | ||
|
||
import org.n52.wps.algorithm.annotation.Algorithm; | ||
import org.n52.wps.algorithm.annotation.Execute; | ||
import org.n52.wps.algorithm.annotation.LiteralDataInput; | ||
import org.n52.wps.algorithm.annotation.LiteralDataOutput; | ||
import org.n52.wps.io.data.binding.literal.LiteralBooleanBinding; | ||
import org.n52.wps.io.data.binding.literal.LiteralIntBinding; | ||
import org.n52.wps.server.AbstractConditionalAnnotatedAlgorithm; | ||
|
||
@Algorithm(version = "1.0.0", title="Integer equals integer", abstrakt="Conditional process which checks if integer a equals integer b") | ||
public class CIntEqInt extends AbstractConditionalAnnotatedAlgorithm { | ||
|
||
int intA, intB; | ||
boolean result; | ||
|
||
@LiteralDataInput(identifier="intA",title="intA", binding=LiteralIntBinding.class) | ||
public void setIntA(int a) { | ||
intA = a; | ||
} | ||
|
||
@LiteralDataInput(identifier="intB",title="intB", binding=LiteralIntBinding.class) | ||
public void setIntB(int b) { | ||
intB = b; | ||
} | ||
|
||
@Override | ||
@LiteralDataOutput(identifier="result", title="result", binding=LiteralBooleanBinding.class) | ||
public boolean getResult() { | ||
return this.result; | ||
} | ||
|
||
@Execute | ||
public void run() { | ||
if (this.intA == this.intB) { | ||
this.result = true; | ||
} | ||
else { | ||
this.result = false; | ||
} | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
richwps/src/main/java/net/disy/wps/richwps/process/conditional/CIntGtInt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package net.disy.wps.richwps.process.conditional; | ||
|
||
import org.n52.wps.algorithm.annotation.Algorithm; | ||
import org.n52.wps.algorithm.annotation.Execute; | ||
import org.n52.wps.algorithm.annotation.LiteralDataInput; | ||
import org.n52.wps.algorithm.annotation.LiteralDataOutput; | ||
import org.n52.wps.io.data.binding.literal.LiteralBooleanBinding; | ||
import org.n52.wps.io.data.binding.literal.LiteralIntBinding; | ||
import org.n52.wps.server.AbstractConditionalAnnotatedAlgorithm; | ||
|
||
@Algorithm(version = "1.0.0", title="Integer greater than integer", abstrakt="Conditional process which checks if integer a is greater than integer b") | ||
public class CIntGtInt extends AbstractConditionalAnnotatedAlgorithm { | ||
|
||
int intA, intB; | ||
boolean result; | ||
|
||
@LiteralDataInput(identifier="intA",title="intA", binding=LiteralIntBinding.class) | ||
public void setIntA(int a) { | ||
intA = a; | ||
} | ||
|
||
@LiteralDataInput(identifier="intB",title="intB", binding=LiteralIntBinding.class) | ||
public void setIntB(int b) { | ||
intB = b; | ||
} | ||
|
||
@Override | ||
@LiteralDataOutput(identifier="result", title="result", binding=LiteralBooleanBinding.class) | ||
public boolean getResult() { | ||
return this.result; | ||
} | ||
|
||
@Execute | ||
public void run() { | ||
if (this.intA > this.intB) { | ||
this.result = true; | ||
} | ||
else { | ||
this.result = false; | ||
} | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
richwps/src/main/java/net/disy/wps/richwps/process/conditional/CIntLtInt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package net.disy.wps.richwps.process.conditional; | ||
|
||
import org.n52.wps.algorithm.annotation.Algorithm; | ||
import org.n52.wps.algorithm.annotation.Execute; | ||
import org.n52.wps.algorithm.annotation.LiteralDataInput; | ||
import org.n52.wps.algorithm.annotation.LiteralDataOutput; | ||
import org.n52.wps.io.data.binding.literal.LiteralBooleanBinding; | ||
import org.n52.wps.io.data.binding.literal.LiteralIntBinding; | ||
import org.n52.wps.server.AbstractConditionalAnnotatedAlgorithm; | ||
|
||
@Algorithm(version = "1.0.0", title="Integer less than integer", abstrakt="Conditional process which checks if integer a is less than integer b") | ||
public class CIntLtInt extends AbstractConditionalAnnotatedAlgorithm { | ||
|
||
int intA, intB; | ||
boolean result; | ||
|
||
@LiteralDataInput(identifier="intA",title="intA", binding=LiteralIntBinding.class) | ||
public void setIntA(int a) { | ||
intA = a; | ||
} | ||
|
||
@LiteralDataInput(identifier="intB",title="intB", binding=LiteralIntBinding.class) | ||
public void setIntB(int b) { | ||
intB = b; | ||
} | ||
|
||
@Override | ||
@LiteralDataOutput(identifier="result", title="result", binding=LiteralBooleanBinding.class) | ||
public boolean getResult() { | ||
return this.result; | ||
} | ||
|
||
@Execute | ||
public void run() { | ||
if (this.intA < this.intB) { | ||
this.result = true; | ||
} | ||
else { | ||
this.result = false; | ||
} | ||
} | ||
|
||
} |