From 78e369043f95e78b27c265f7eab4d766e54054f4 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Fri, 12 Aug 2016 22:27:26 +0200 Subject: Refactored a lot of things, started adding the rest of the filtering --- src/eu/equalparts/cardbase/cardfield/IntegerCardField.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/eu/equalparts/cardbase/cardfield') 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 { @@ -16,6 +17,14 @@ public class IntegerCardField extends CardField { 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; } -- cgit v1.2.3