MCPcopy
hub / github.com/ccxt/ccxt / isGreaterThan

Method isGreaterThan

java/lib/src/main/java/io/github/ccxt/Helpers.java:319–337  ·  view source on GitHub ↗
(Object a, Object b)

Source from the content-addressed store, hash-verified

317 }
318
319 public static boolean isGreaterThan(Object a, Object b) {
320 if (a != null && b == null) return true;
321 if (a == null || b == null) return false;
322
323 a = normalizeIntIfNeeded(a);
324 b = normalizeIntIfNeeded(b);
325
326 if (a instanceof Long && b instanceof Long) {
327 return ((Long) a) > ((Long) b);
328 } else if (a instanceof Integer && b instanceof Integer) {
329 return ((Integer) a) > ((Integer) b);
330 } else if (isNumber(a) || isNumber(b)) {
331 return toDouble(a) > toDouble(b);
332 } else if (a instanceof String && b instanceof String) {
333 return ((String) a).compareTo((String) b) > 0;
334 } else {
335 return false;
336 }
337 }
338
339 public static boolean isLessThan(Object a, Object b) {
340 return !isGreaterThan(a, b) && !isEqual(a, b);

Callers 15

checkProxyUrlSettingsMethod · 0.95
checkProxySettingsMethod · 0.95
checkWsProxySettingsMethod · 0.95
checkAddressMethod · 0.95
filterByLimitMethod · 0.95
initRestRateLimiterMethod · 0.95
setMarketsMethod · 0.95
safeOrderMethod · 0.95
buildOHLCVCMethod · 0.95
parsePrecisionMethod · 0.95
checkRequiredArgumentMethod · 0.95

Calls 3

normalizeIntIfNeededMethod · 0.95
isNumberMethod · 0.95
toDoubleMethod · 0.95

Tested by 15

isGreaterThanMethod · 0.76
testLoadMarketsMethod · 0.76
testFetchLedgerEntryMethod · 0.76
testFetchLastPricesMethod · 0.76
testFetchCurrenciesMethod · 0.76
testOrderBookMethod · 0.76
AssertTimestampMethod · 0.76
AssertTimestampOrderMethod · 0.76
AssertNonEmtpyArrayMethod · 0.76
initInnerMethod · 0.76
addPaddingMethod · 0.76
testMethodMethod · 0.76