Initial revision
// public final class Fixnum extends LispObject{ int val; Fixnum(int val){ this.val=val; } Fixnum(String name){ this(Integer.parseInt(name)); } public int getType(){ return FIXNUM; } public int getInteger(){ return val; } public String toString(){ return ""+val; } public static boolean isFixnumString(String name){ char c; if(name.length()==0) return false; if((c=name.charAt(0))=='+' || c=='-'){ name=name.substring(1); } int i,len; if((len=name.length())==0) return false; for(i=0;i<len;i++) if(!Character.isDigit(name.charAt(i))) return false; return true; } }
ktanaka Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |