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

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

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

Memory.toChar介绍

暂无

代码示例

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

@Override
public Character convert(Environment env, TraceInfo trace, Memory arg) throws Throwable {
  return arg.toChar();
}

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

@Override
  protected String toValue(Memory[] args) {
    return String.valueOf(args[_index].toChar());
  }
}

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

@Override
  public char toChar() {
    return toImmutable().toChar();
  }
}

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

@Override
public char[] convert(Environment env, TraceInfo trace, Memory arg) throws Throwable {
  char[] result = new char[((ArrayMemory)arg).size()];
  int i = 0;
  for (Memory el : (ArrayMemory)arg) {
    result[i++] = el.toChar();
  }
  return result;
}

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

@Override
public char toChar() {
  return getValue().toChar();
}

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

@Signature({
    @Arg("number"),
    @Arg("pattern"),
    @Arg(value = "decSep", optional = @Optional(".")),
    @Arg(value = "groupSep", optional = @Optional(","))
})
public static Memory format(Environment env, Memory... args) {
  try {
    char decSep = args[2].toChar();
    char groupSep = args[3].toChar();
    DecimalFormat decimalFormat;
    if (decSep == '.' && groupSep == ',')
      decimalFormat = new DecimalFormat(args[1].toString(), DEFAULT_DECIMAL_FORMAT_SYMBOLS);
    else {
      DecimalFormatSymbols formatSymbols = new DecimalFormatSymbols();
      formatSymbols.setZeroDigit('0');
      formatSymbols.setDecimalSeparator(decSep);
      formatSymbols.setGroupingSeparator(groupSep);
      decimalFormat = new DecimalFormat(args[1].toString(), formatSymbols);
    }
    return new StringMemory(decimalFormat.format(args[0].toDouble()));
  } catch (IllegalArgumentException e) {
    return Memory.FALSE;
  }
}

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

@FastMethod
@Signature(@Arg("char"))
public static Memory ord(Environment env, Memory... args) {
  return LongMemory.valueOf((int) args[0].toChar());
}

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

ch = needle.toChar();

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

ch = needle.toChar();

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

ch = Character.toUpperCase(needle.toChar());

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

return (byte)value.toLong();
if (type == Character.TYPE || type == Character.class)
  return value.toChar();
if (type == String.class)
  return value.toString();

相关文章