aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/equalparts/cardbase/cardfield
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2016-08-12 22:27:26 +0200
committerEduardo Pedroni <e.pedroni91@gmail.com>2016-08-12 22:27:26 +0200
commit78e369043f95e78b27c265f7eab4d766e54054f4 (patch)
tree4298ac164cb09c4ce6bfe12f4d1a59b7ccb2ca32 /src/eu/equalparts/cardbase/cardfield
parent0db469d9ae90ad5b72eb0c93952e9ecc68a6d4e7 (diff)
Refactored a lot of things, started adding the rest of the filtering
Diffstat (limited to 'src/eu/equalparts/cardbase/cardfield')
-rw-r--r--src/eu/equalparts/cardbase/cardfield/IntegerCardField.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/eu/equalparts/cardbase/cardfield/IntegerCardField.java b/src/eu/equalparts/cardbase/cardfield/IntegerCardField.java
index 4016252..3ee10e7 100644
--- a/src/eu/equalparts/cardbase/cardfield/IntegerCardField.java
+++ b/src/eu/equalparts/cardbase/cardfield/IntegerCardField.java
@@ -1,5 +1,6 @@
package eu.equalparts.cardbase.cardfield;
import eu.equalparts.cardbase.filtering.CardFiltering.Filter;
+import eu.equalparts.cardbase.utils.InputSanity;
public class IntegerCardField extends CardField<Integer> {
@@ -16,6 +17,14 @@ public class IntegerCardField extends CardField<Integer> {
return get().toString().equalsIgnoreCase(s);
case REGEX:
return get().toString().matches(s);
+ case GREATER_THAN:
+ if (InputSanity.isInteger(s)) {
+ return get() > Integer.valueOf(s);
+ }
+ case SMALLER_THAN:
+ if (InputSanity.isInteger(s)) {
+ return get() < Integer.valueOf(s);
+ }
default:
return false;
}