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
testautoa-0.4.4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.5.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
testautoa-0.4.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
testautoa-0.4.2.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.3.pre8 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.3.pre7 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.3.pre6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.3.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.3.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.3.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
testautoa-0.4.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.3.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.3.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
testautoa-0.4.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java
calabash-android-0.4.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java