// ino.module.UsedId.8567.package package mycompiler.myclass; // ino.end // ino.module.UsedId.8567.import import java.util.Iterator; import java.util.Vector; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; import typinferenz.TypinferenzException; import mycompiler.IItemWithOffset; import mycompiler.mybytecode.JVMCode; import mycompiler.mytype.Type; // ino.end // ino.class.UsedId.23659.declaration public class UsedId implements IItemWithOffset // ino.end // ino.class.UsedId.23659.body { // ino.attribute.name.23663.declaration public Vector name = new Vector(); // Vector mit Strings // ino.end // ino.attribute.typen.23666.declaration private Vector typen = new Vector(); // Vector mit Typen // ino.end // ino.attribute.paralist.23669.declaration private Vector paralist = null; // ino.end // ino.attribute.vParaOrg.23672.declaration public Vector vParaOrg = null; // otth: originale Parameterliste // ino.end private int m_Offset = -1; //hinzugef�gt hoth: 07.04.2006 // ino.method.UsedId.23675.definition public UsedId(int offset) // ino.end // ino.method.UsedId.23675.body { m_Offset=offset; } // ino.end public UsedId(String name, int offset) { this(offset); this.set_Name(name); } // ino.method.getOffset.23678.defdescription type=line // hinzugef�gt hoth: 07.04.2006 // ino.end // ino.method.getOffset.23678.definition public int getOffset() // ino.end // ino.method.getOffset.23678.body { return m_Offset; } // ino.end // ino.method.getVariableLength.23681.definition public int getVariableLength() // ino.end // ino.method.getVariableLength.23681.body { return get_Name_1Element().length(); } // ino.end // ino.method.setOffset.23684.defdescription type=line // hinzugef�gt hoth: 07.04.2006 // ino.end // ino.method.setOffset.23684.definition public void setOffset(int Offset) // ino.end // ino.method.setOffset.23684.body { m_Offset = Offset; } // ino.end // ino.method.set_Name.23687.definition public void set_Name( String name) // ino.end // ino.method.set_Name.23687.body { this.name.addElement(name); } // ino.end // ino.method.get_Name.23690.definition public Vector get_Name() // ino.end // ino.method.get_Name.23690.body { return name; } // ino.end // ino.method.get_Name_1Element.23693.definition public String get_Name_1Element() // ino.end // ino.method.get_Name_1Element.23693.body { return (String) name.elementAt(0); } // ino.end // ino.method.set_Typen.23696.definition public void set_Typen(Vector t) // ino.end // ino.method.set_Typen.23696.body { typen=t; } // ino.end // ino.method.set_ParaList.23699.definition public void set_ParaList(Vector pl) // ino.end // ino.method.set_ParaList.23699.body { this.paralist = pl; } // ino.end // ino.method.get_RealParaList.23702.definition public Vector get_RealParaList() // ino.end // ino.method.get_RealParaList.23702.body { return this.paralist; } // ino.end // ino.method.get_ParaList.23705.definition public Vector get_ParaList() // ino.end // ino.method.get_ParaList.23705.body { if(this.paralist != null) return this.paralist; else return new Vector(); } // ino.end // ino.method.get_vParaOrg.23708.definition public Vector get_vParaOrg() // ino.end // ino.method.get_vParaOrg.23708.body { return this.vParaOrg; } // ino.end // ino.method.get_Typen.23711.definition public Vector get_Typen() // ino.end // ino.method.get_Typen.23711.body { return typen; } // ino.end // ino.method.get_codegen_UsedId.23714.definition public String get_codegen_UsedId() // ino.end // ino.method.get_codegen_UsedId.23714.body { String name_string = new String(); name_string += (String)name.elementAt(0); for(int i = 1; i < name.size(); i++) name_string += ("/" + (String)name.elementAt(i)); return name_string; } // ino.end // ino.method.getSignatureUsedId.23717.definition public String getSignatureUsedId() // ino.end // ino.method.getSignatureUsedId.23717.body { String basis = JVMCode.get_codegen_Type(getQualifiedName(),null); if (paralist == null || paralist.size() ==0) return basis; StringBuffer sb = new StringBuffer(); // Basistyp, ; entfernen basis = basis.substring(0, basis.length() -1); sb.append(basis); sb.append("<"); for(int i = 0; i< paralist.size(); i++) { sb.append(paralist.elementAt(i).get_codegen_Type(null)); } sb.append(">;"); return sb.toString(); } // ino.end // ino.method.removeLast.23720.definition public void removeLast() // ino.end // ino.method.removeLast.23720.body { name.removeElementAt(name.size()-1); } // ino.end // ino.method.toString.23723.defdescription type=javadoc /** *
Author: Martin Pl�micke * @return */ // ino.end // ino.method.toString.23723.definition public String toString() // ino.end // ino.method.toString.23723.body { return this.get_Name_1Element();//name.toString(); //geändert von Andreas Stadelmeier /*String s = ""; for(int i = 0; i(); for(int i=0;i0){ return(name.elementAt(name.size()-1).equals("*")); } return(false); } // ino.end // ino.method.getPackageName.23735.definition public UsedId getPackageName() // ino.end // ino.method.getPackageName.23735.body { UsedId uid=new UsedId(-1); uid.name=new Vector(); for(int i=0;i0) return name.lastElement(); else return null; } // ino.end public JavaCodeResult printJavaCode(ResultSet resultSet) { if(this.name.size()>1)throw new TypinferenzException("Es kann maximal nur eine Superklasse pro Klasse geben"); JavaCodeResult ret = new JavaCodeResult(this.getQualifiedName()); if(this.paralist != null){ ret.attach( "<" ); Iterator it = this.paralist.iterator(); while(it.hasNext()){ Type para = it.next(); ret.attach(para.printJavaCode(resultSet)); if(it.hasNext())ret.attach(", "); } //ret = ret.substring(0, ret.length()-2); ret.attach(">"); } return ret; } } // ino.end