本文整理了Java中php.runtime.Memory.greater()
方法的一些代码示例,展示了Memory.greater()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Memory.greater()
方法的具体详情如下:
包路径:php.runtime.Memory
类名称:Memory
方法名:greater
暂无
代码示例来源:origin: jphp-group/jphp
@Override
public Memory calc(Environment env, TraceInfo trace, Memory o1, Memory o2) {
return o1.greater(o2) ? Memory.TRUE : Memory.FALSE;
}
}
代码示例来源:origin: jphp-group/jphp
public boolean smallerEqRight(double value) { return this.greater(value); }
public boolean smallerEqRight(boolean value) { return this.greater(value); }
代码示例来源:origin: jphp-group/jphp
public boolean greaterRight(Memory value) { return value.greater(this); }
public boolean greaterRight(long value) { return this.smallerEq(value); }
代码示例来源:origin: jphp-group/jphp
public boolean smallerEqRight(String value) { return this.greater(value); }
代码示例来源:origin: jphp-group/jphp
@Override
public int compareTo(Memory o) {
if (greater(o))
return 1;
else if (smaller(o))
return -1;
else
return 0;
}
代码示例来源:origin: jphp-group/jphp
/********** RIGHT ******************/
// SPACESHIP
public long spaceshipCompareRight(Memory value) { return equal(value) ? 0 : greater(value) ? -1 : 1; }
public long spaceshipCompareRight(long value) { return equal(value) ? 0 : greater(value) ? -1 : 1; }
代码示例来源:origin: jphp-group/jphp
@Override
public boolean greater(Memory memory) {
return getValue().greater(memory);
}
代码示例来源:origin: jphp-group/jphp
@Override
public boolean greater(String value) {
return this.getValue().greater(value);
}
代码示例来源:origin: jphp-group/jphp
@Override
public boolean greater(long value) {
return this.getValue().greater(value);
}
代码示例来源:origin: jphp-group/jphp
@Override
public boolean greater(double value) {
return this.getValue().greater(value);
}
代码示例来源:origin: jphp-group/jphp
@Override
public boolean greater(boolean value) {
return this.getValue().greater(value);
}
代码示例来源:origin: jphp-group/jphp
public long spaceshipCompareRight(boolean value) { return equal(value) ? 0 : greater(value) ? -1 : 1; }
public long spaceshipCompareRight(String value) { return equal(value) ? 0 : greater(value) ? -1 : 1; }
代码示例来源:origin: jphp-group/jphp
public long spaceshipCompare(Memory value) { return equal(value) ? 0 : greater(value) ? 1 : -1; }
public long spaceshipCompare(long value) { return equal(value) ? 0 : greater(value) ? 1 : -1; }
代码示例来源:origin: jphp-group/jphp
public long spaceshipCompare(double value) { return equal(value) ? 0 : greater(value) ? 1 : -1; }
public long spaceshipCompare(boolean value) { return equal(value) ? 0 : greater(value) ? 1 : -1; }
代码示例来源:origin: jphp-group/jphp
public long spaceshipCompare(boolean value) { return equal(value) ? 0 : greater(value) ? 1 : -1; }
public long spaceshipCompare(String value) { return equal(value) ? 0 : greater(value) ? 1 : -1; }
代码示例来源:origin: jphp-group/jphp
public long spaceshipCompareRight(double value) { return equal(value) ? 0 : greater(value) ? -1 : 1; }
public long spaceshipCompareRight(boolean value) { return equal(value) ? 0 : greater(value) ? -1 : 1; }
代码示例来源:origin: jphp-group/jphp
public long spaceshipCompare(String value) { return equal(value) ? 0 : greater(value) ? 1 : -1; }
代码示例来源:origin: jphp-group/jphp
@Override
public int compare(Memory o1, Memory o2) {
o1 = o1.toNumeric();
o2 = o2.toNumeric();
return o1.equal(o2) ? 0 : (o1.greater(o2) ? 1 : -1) * (revert ? -1 : 1);
}
};
代码示例来源:origin: jphp-group/jphp
@Override
public boolean greater(Memory memory) {
switch (memory.type){
case STRING: return toString().compareTo(memory.toString()) > 0;
case REFERENCE: return greater(memory.toValue());
}
return toNumeric().greater(memory);
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg(value = "comparator", type = HintType.CALLABLE, nullable = true, optional = @Optional("null")))
public Memory max(Environment env, Memory... args) {
Invoker comparator = args[0].isNull() ? null : Invoker.create(env, args[0]);
return getSelfIterator(env)
.stream()
.reduce((one, two) -> {
if (comparator == null) {
return two.greater(one) ? two : one;
} else {
return comparator.callNoThrow(one, two).toLong() > 0 ? one : two;
}
}).orElse(Memory.NULL);
}
内容来源于网络,如有侵权,请联系作者删除!