Initial revision
public final class Element { static String[] elementNames={ "ten","tate","yoko","migiue","hidari","tatehidari","migi","kozato", "tatehane","tsukurihane","sanzui","kokoro","tasuki","magaritate", "kagi","shin-nyuu","hira-long","hira-circle","outline" }; static final int ten=0; static final int tate=1; static final int yoko=2; static final int migiue=3; static final int hidari=4; static final int tatehidari=5; static final int migi=6; static final int kozato=7; static final int tatehane=8; static final int tsukurihane=9; static final int sanzui=10; static final int kokoro=11; static final int tasuki=12; static final int magaritate=13; static final int kagi=14; static final int shin_nyuu=15; static final int hira_long=16; static final int hira_circle=17; static final int outline=18; int type; int[] points; int[] links; ElementAnnotation[] annotations; Element(int type,int[] points,int[] links,ElementAnnotation[] annotations){ this.type=type; this.points=points; this.links=links; this.annotations=annotations; } static int stringToType(String name){ int i,len=elementNames.length; for(i=0;i<len;i++) if(name.equals(elementNames[i])) break; if(i==len){ System.err.println("Illegal element tag("+name+")"); return -1; } return i; } int[] getPoints(){ return points; } public String toString(){ String ret=elementNames[type]+"(points("; int i,len=points.length; for(i=0;i<len;i++) ret+=points[i]+","; ret+=")"; if(links!=null){ len=links.length; ret+=",links("; for(i=0;i<len;i++) ret+=links[i]+","; ret+=")"; } return ret+")"; } }
ktanaka Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |