php.runtime.Memory.inc()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中php.runtime.Memory.inc()方法的一些代码示例,展示了Memory.inc()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Memory.inc()方法的具体详情如下:
包路径:php.runtime.Memory
类名称:Memory
方法名:inc

Memory.inc介绍

暂无

代码示例

代码示例来源:origin: jphp-group/jphp

public void pushValue(Memory value) {
    key = key.inc();
    this.value = value;
  }
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory inc() {
  return getValue().inc();
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory inc() {
  return toNumeric().inc();
}

代码示例来源:origin: jphp-group/jphp

@Override
public Memory inc() {
  return toValue().inc();
}

代码示例来源:origin: jphp-group/jphp

@Override
protected boolean nextValue() {
  if (!iterator.hasNext()) {
    return false;
  }
  Object next = iterator.next();
  currentKeyMemory = currentKeyMemory == null ? Memory.CONST_INT_0 : currentKeyMemory.inc();
  currentKey = currentKeyMemory.toLong();
  currentValue = Memory.wrap(env, next);
  return true;
}

代码示例来源:origin: jphp-group/jphp

@Override
@Signature
public Memory next(Environment env, Memory... args) {
  valid = matcher.find();
  if (valid) {
    current = StringMemory.valueOf(matcher.group());
    key = key.inc();
  } else {
    key = Memory.NULL;
    current = Memory.NULL;
  }
  return Memory.NULL;
}

代码示例来源:origin: jphp-group/jphp

@Override
public boolean next(final Environment env) {
  if (iterator.next()) {
    current = iterator.getMemoryKey();
    key = key == null ? Memory.CONST_INT_0 : key.inc();
    return true;
  }
  return false;
}

代码示例来源:origin: jphp-group/jphp

@Override
protected boolean nextValue() {
  if (i < length) {
    int endIndex = i + chunkSize;
    if (endIndex > length)
      endIndex = length;
    currentValue = chunkSize == 1
        ? StringMemory.valueOf(string.charAt(i))
        : StringMemory.valueOf(string.substring(i, endIndex));
    if (currentKeyMemory == null)
      currentKeyMemory = LongMemory.valueOf(0);
    currentKeyMemory = currentKeyMemory.inc();
    currentKey = currentKeyMemory;
    i += chunkSize;
    return true;
  }
  return false;
}

代码示例来源:origin: jphp-group/jphp

return ret.inc();

代码示例来源:origin: jphp-group/jphp

@Override
protected boolean nextValue() {
  if (iterator.hasNext()) {
    Document document = iterator.tryNext();
    if (document == null) {
      return false;
    }
    this.currentValue = Memory.wrap(env, document);
    this.currentKeyMemory = counter;
    this.currentKey = counter;
    counter = counter.inc();
    return true;
  } else {
    return false;
  }
}

代码示例来源:origin: jphp-group/jphp

@Signature(@Arg(value = "pattern", nativeType = WrapRegex.class, optional = @Optional("null")))
public Memory next(Environment env, Memory... args) {
  try {
    key = key.inc();
    return current = StringMemory.valueOf(args.length == 0 || args[0].isNull()
        ? scanner.next()
        : scanner.next(args[0].toObject(WrapRegex.class).getMatcher().pattern())
    );
  } catch (NoSuchElementException e) {
    valid = false;
    current = Memory.NULL;
    key = Memory.NULL;
    return Memory.NULL;
  }
}

代码示例来源:origin: jphp-group/jphp

public static Memory array_count_values(Environment env, TraceInfo trace, Memory input) {
  if (expecting(env, trace, 1, input, ARRAY)) {
    ArrayMemory counts = new ArrayMemory();
    ForeachIterator iterator = input.getNewIterator(env, false, false);
    boolean warning = false;
    while (iterator.next()) {
      Memory value = iterator.getValue();
      switch (value.getRealType()) {
        case INT:
        case STRING:
          Memory count = counts.getOrCreate(value);
          count.assign(count.inc());
          break;
        default:
          if (!warning) {
            env.warning(trace, "array_count_values(): Can only count STRING and INTEGER values!");
            warning = true;
          }
      }
    }
    return counts.toConstant();
  } else
    return Memory.NULL;
}

代码示例来源:origin: jphp-group/jphp

@Override
protected boolean nextValue() {
  Memory r = new ArrayMemory();
  boolean done = false;
  while (iterator.next()) {
    done = true;
    if (withKeys)
      r.refOfIndex(iterator.getMemoryKey()).assign(iterator.getValue());
    else
      r.refOfPush().assign(iterator.getValue());
    if (call(iterator, invoker).toBoolean())
      break;
  }
  if (done) {
    currentKeyMemory = key.inc();
    currentKey = currentKeyMemory;
    currentValue = r;
  }
  return done;
}

相关文章