Package jmri.util
Class CompareUtil
- java.lang.Object
-
- jmri.util.CompareUtil
-
public class CompareUtil extends java.lang.Object
Compare values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CompareUtil.CompareOperation
static class
CompareUtil.CompareType
-
Constructor Summary
Constructors Constructor Description CompareUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
compare(CompareUtil.CompareType type, CompareUtil.CompareOperation oper, java.lang.Object value1, java.lang.Object value2, boolean caseInsensitive)
Compare two values.static boolean
compareNumber(boolean requireNumber, CompareUtil.CompareOperation oper, java.lang.Object value1, java.lang.Object value2, boolean caseInsensitive)
Compare two values.static boolean
compareString(CompareUtil.CompareOperation oper, java.lang.Object value1, java.lang.Object value2, boolean caseInsensitive)
Compare two values.
-
-
-
Constructor Detail
-
CompareUtil
public CompareUtil()
-
-
Method Detail
-
compare
public static boolean compare(CompareUtil.CompareType type, CompareUtil.CompareOperation oper, java.lang.Object value1, java.lang.Object value2, boolean caseInsensitive)
Compare two values.- Parameters:
type
- the typeoper
- the operationvalue1
- left side of the comparisonvalue2
- right side of the comparisoncaseInsensitive
- true if comparison should be case insensitive; false otherwise- Returns:
- true if values compare per _memoryOperation; false otherwise
-
compareString
public static boolean compareString(CompareUtil.CompareOperation oper, java.lang.Object value1, java.lang.Object value2, boolean caseInsensitive)
Compare two values.- Parameters:
oper
- the operationvalue1
- left side of the comparisonvalue2
- right side of the comparisoncaseInsensitive
- true if comparison should be case insensitive; false otherwise- Returns:
- true if values compare per _memoryOperation; false otherwise
-
compareNumber
public static boolean compareNumber(boolean requireNumber, CompareUtil.CompareOperation oper, java.lang.Object value1, java.lang.Object value2, boolean caseInsensitive)
Compare two values.- Parameters:
requireNumber
- true if two numbers are required, false otherwiseoper
- the operationvalue1
- left side of the comparisonvalue2
- right side of the comparisoncaseInsensitive
- true if comparison should be case insensitive; false otherwise- Returns:
- true if values compare per _memoryOperation; false otherwise
-
-