本文整理了Java中php.runtime.Memory.toBoolean()
方法的一些代码示例,展示了Memory.toBoolean()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Memory.toBoolean()
方法的具体详情如下:
包路径:php.runtime.Memory
类名称:Memory
方法名:toBoolean
暂无
代码示例来源:origin: jphp-group/jphp
@Override
public Memory calc(Environment env, TraceInfo trace, Memory o1, Memory o2) {
return o1.toBoolean() && o2.toBoolean() ? Memory.TRUE : Memory.FALSE;
}
}
代码示例来源:origin: jphp-group/jphp
public void writeBoolean(Memory memory) {
printer.append("b:")
.append(memory.toBoolean() ? "1" : "0")
.append(";");
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg("on"))
public Memory setReuseAddress(Environment env, Memory... args) throws SocketException {
socket.setReuseAddress(args[0].toBoolean());
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg("on"))
public Memory setReuseAddress(Environment env, Memory... args) throws SocketException {
socket.setReuseAddress(args[0].toBoolean());
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
@Signature
public Memory setDaemon(Environment env, Memory... args){
thread.setDaemon(args[0].toBoolean());
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg("on"))
public Memory setKeepAlive(Environment env, Memory... args) throws SocketException {
socket.setKeepAlive(args[0].toBoolean());
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg("accessible"))
public Memory setAccessible(Environment env, Memory... args){
hackAccess = args[0].toBoolean();
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg("accessible"))
public Memory setAccessible(Environment env, Memory... args){
hackAccess = args[0].toBoolean();
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg("on"))
public Memory setOOBInline(Environment env, Memory... args) throws SocketException {
socket.setOOBInline(args[0].toBoolean());
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg("value"))
public Memory setDaemon(Environment env, Memory... args){
group.setDaemon(args[0].toBoolean());
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
@Signature({
@Arg(value = "timeZone", nativeType = WrapTimeZone.class),
@Arg(value = "globally", optional = @Optional("false"))
})
public static Memory setDefault(Environment env, Memory... args) {
if (args[1].toBoolean())
TimeZone.setDefault(args[0].toObject(WrapTimeZone.class).timeZone);
else
env.setUserValue(WrapTime.class.getName() + "#def_time_zone", args[0].toObject(WrapTimeZone.class).timeZone);
return Memory.NULL;
}
代码示例来源:origin: jphp-group/jphp
protected boolean eof() {
env.pushCall(stream, "eof");
try {
return stream.eof(env).toBoolean();
} finally {
env.popCall();
}
}
代码示例来源:origin: jphp-group/jphp
@Signature({
@Arg("name"),
@Arg("allowsNull"),
@Arg("isBuiltin")
})
public Memory __construct(Environment env, Memory... args) {
allowsNull = args[1].toBoolean();
isBuiltin = args[2].toBoolean();
name = StringMemory.valueOf(args[0].toString());
return Memory.UNDEFINED;
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg(value = "globally", optional = @Optional("false")))
public static Memory getDefault(Environment env, Memory... args) {
return new ObjectMemory(new WrapTimeZone(env,
args[0].toBoolean() ? TimeZone.getDefault() : getTimeZone(env, Memory.NULL)));
}
代码示例来源:origin: jphp-group/jphp
@Override
public boolean accept(File dir, String name) {
FileObject o = new FileObject(env, __class__, dir);
Memory[] args = new Memory[]{new ObjectMemory(o), new StringMemory(name)};
return invoker.callNoThrow(args).toBoolean();
}
});
代码示例来源:origin: jphp-group/jphp
public boolean onException(Environment env, BaseBaseException exception)
throws Throwable {
Memory[] args = new Memory[]{new ObjectMemory(exception)};
invoker.setTrace(exception.getTrace());
return invoker.call(args).toBoolean();
}
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg(value = "predicate", type = HintType.CALLABLE))
public Memory noneMatch(Environment env, Memory... args) {
final Invoker invoker = Invoker.valueOf(env, null, args[0]);
while (iterator.next()) {
if (call(iterator, invoker).toBoolean()) {
return Memory.FALSE;
}
}
return Memory.TRUE;
}
代码示例来源:origin: jphp-group/jphp
@Signature(@Arg(value = "predicate", type = HintType.CALLABLE))
public Memory anyMatch(Environment env, Memory... args) {
final Invoker invoker = Invoker.valueOf(env, null, args[0]);
while (iterator.next()) {
if (call(iterator, invoker).toBoolean()) {
return Memory.TRUE;
}
}
return Memory.FALSE;
}
代码示例来源:origin: jphp-group/jphp
@Test
public void testAnd(){
Memory memory = runDynamic("$x && true");
Assert.assertEquals(false, memory.toBoolean());
memory = runDynamic("$x and true");
Assert.assertEquals(false, memory.toBoolean());
}
代码示例来源:origin: jphp-group/jphp
@Signature({
@Arg("name"), @Arg("value"),
@Arg(value = "caseSensitive", optional = @Optional(value = "true", type = HintType.BOOLEAN))
})
public Memory defineConstant(Environment env, Memory... args){
Memory val = args[1].toValue();
if (val.isArray() || val.isObject())
env.exception("Argument 2 must be a scalar value");
if (!environment.defineConstant(args[0].toString(), val, args[2].toBoolean()))
env.exception("Constant '%s' already registered", args[0]);
return Memory.NULL;
}
内容来源于网络,如有侵权,请联系作者删除!