public static IntegerSym valueOf(final int newnum) { return (newnum >= low && newnum <= high) ? cache[newnum + (-low)] : new IntegerSym(newnum); }
/** * Be cautious with this method, no new internal BigInteger is created * * @param value * @return */ protected static IntegerSym newInstance(final BigInteger value) { // IntegerSym z; // if (Config.SERVER_MODE) { // z = FACTORY.object(); // } else { // z = new IntegerSym(); // } IntegerSym z = new IntegerSym(); z.fInteger = value; return z; }
public static IntegerSym valueOf(final long value) { // IntegerSym z; // if (Config.SERVER_MODE) { // z = FACTORY.object(); // } else { // z = new IntegerSym(); // } IntegerSym z = new IntegerSym(); z.fInteger = BigInteger.valueOf(value); return z; }
/** * Returns the IntegerImpl for the specified character sequence stated in the * specified radix. The characters must all be digits of the specified radix, * except the first character which may be a plus sign <code>'+'</code> or a * minus sign <code>'-'</code>. * * @param chars * the character sequence to parse. * @param radix * the radix to be used while parsing. * @return the corresponding large integer. * @throws NumberFormatException * if the specified character sequence does not contain a parsable * large integer. */ public static IntegerSym valueOf(final String integerString, final int radix) { // IntegerSym z; // if (Config.SERVER_MODE) { // z = FACTORY.object(); // } else { // z = new IntegerSym(); // } IntegerSym z = new IntegerSym(); z.fInteger = new BigInteger(integerString, radix); return z; }
return new IntegerSym(value); } catch (NumberFormatException nfe) {
int j = low; for (int k = 0; k < cache.length; k++) { cache[k] = new IntegerSym(j++);