Changeset 11647


Ignore:
Timestamp:
02/08/09 21:23:48 (13 years ago)
Author:
ehuelsmann
Message:

Add support for java.lang.Long arguments based on Bignums.

Found by: ayrnieu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Bignum.java

    r11579 r11647  
    6464    return value;
    6565  }
     66
     67  @Override
     68  public Object javaInstance(Class c) {
     69    String cn = c.getName();
     70    if (cn.equals("java.lang.Byte") || cn.equals("byte"))
     71      return Byte.valueOf((byte)value.intValue());
     72    if (cn.equals("java.lang.Short") || cn.equals("short"))
     73      return Short.valueOf((short)value.intValue());
     74    if (cn.equals("java.lang.Integer") || cn.equals("int"))
     75      return Integer.valueOf(value.intValue());
     76    if (cn.equals("java.lang.Long") || cn.equals("long"))
     77      return Long.valueOf((long)value.longValue());
     78    return javaInstance();
     79  }
     80
    6681
    6782  @Override
Note: See TracChangeset for help on using the changeset viewer.