[wadalabfont-kit] / java / Fixnum.java  

View of /java/Fixnum.java

Parent Directory | Revision Log
Revision: 1.1.1.1 - (download) (as text) (annotate) (vendor branch)
Thu Dec 28 08:54:22 2000 UTC (23 years, 11 months ago) by ktanaka
Branch: ktanaka, MAIN
CVS Tags: SNAP-20030702, tmp, SNAP-20030624, SNAP-20030630, SNAP-20040518, HEAD
Changes since 1.1: +0 -0 lines
change to CVS wadalab font project
//
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