List of usage examples for java.lang Character isValidCodePoint
public static boolean isValidCodePoint(int codePoint)
From source file:org.rascalmpl.library.Prelude.java
public IValue stringChar(IInteger i) { int intValue = i.intValue(); if (Character.isValidCodePoint(intValue)) { return values.string(intValue); } else {//from w ww . j ava 2 s . c om throw RuntimeExceptionFactory.illegalArgument(i, null, null); } }
From source file:org.rascalmpl.library.Prelude.java
public IValue stringChars(IList lst) { int[] chars = new int[lst.length()]; for (int i = 0; i < lst.length(); i++) { chars[i] = ((IInteger) lst.get(i)).intValue(); if (!Character.isValidCodePoint(chars[i])) { throw RuntimeExceptionFactory.illegalArgument(values.integer(chars[i]), null, null); }//ww w.j av a2s . c om } return values.string(chars); }