Sha256: bc0a539ee0efa243210d798db741ea6ca00a6d0c8bd62bed802f66515e3f0de2

Contents?: true

Size: 1.5 KB

Versions: 69

Compression:

Stored size: 1.5 KB

Contents

package sh.calaba.instrumentationbackend.query.ast;

public enum ComparisonOperator implements UIQueryASTPredicateRelation {

	LESSTHAN {
		public boolean areRelated(Object firstValue, Object secondValue) {
			if (areNumbers(firstValue, secondValue)) {
				Number firstNum = (Number) firstValue;
				Number secondNum = (Number) secondValue;
				return firstNum.doubleValue() < secondNum.doubleValue();
			} else {
				return false;
			}
		}
	},

	LESSTHANOREQUAL {
		public boolean areRelated(Object firstValue, Object secondValue) {
			return EQUAL.areRelated(firstValue, secondValue) || LESSTHAN.areRelated(firstValue, secondValue);
		}
	},

	EQUAL {
		public boolean areRelated(Object firstValue, Object secondValue) {
			if (firstValue == secondValue) {
				return true;
			}
			return (firstValue != null) && firstValue.equals(secondValue);					
		}
	},

	GREATERTHAN {
		public boolean areRelated(Object firstValue, Object secondValue) {
			if (areNumbers(firstValue, secondValue)) {
				Number firstNum = (Number) firstValue;
				Number secondNum = (Number) secondValue;
				return firstNum.doubleValue() > secondNum.doubleValue();
			} else {
				return false;
			}
		}
	},

	GREATERTHANOREQUAL {
		public boolean areRelated(Object firstValue, Object secondValue) {
			return EQUAL.areRelated(firstValue, secondValue) || GREATERTHAN.areRelated(firstValue, secondValue);
		}
	};

	protected boolean areNumbers(Object firstValue, Object secondValue) {
		return (firstValue instanceof Number && secondValue instanceof Number);
	}

}

Version data entries

69 entries across 69 versions & 2 rubygems

Version Path
calabash-android-0.4.20.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.22.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.22.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.22.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.21 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.20 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.19 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.19.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.19.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.19.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.19.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.18 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.16 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.15.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.15.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.14 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.13 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.12 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.11 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.10.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java