001    package AST;
002    
003    import java.util.HashSet;
004    import java.io.File;
005    import java.util.*;
006    import beaver.*;
007    import java.util.ArrayList;
008    import java.util.zip.*;
009    import java.io.*;
010    import java.io.FileNotFoundException;
011    import java.util.Collection;
012    /**
013      * @ast class
014     * 
015     */
016    public class ConstantMethodref extends CPInfo {
017    
018        private int classname;
019    
020    
021        private int nameandtype;
022    
023    
024        public ConstantMethodref(int classname, int nameandtype) {
025          this.classname = classname;
026          this.nameandtype = nameandtype;
027        }
028    
029    
030    
031        public void emit(DataOutputStream out) throws IOException {
032          out.writeByte(ConstantPool.CONSTANT_Methodref);
033          out.writeChar(classname);
034          out.writeChar(nameandtype);
035        }
036    
037    
038        public String toString() {
039          return pos + " ConstantMethodref: tag " + ConstantPool.CONSTANT_Methodref + ", class_index: " + classname + ", name_and_type_index: " + nameandtype;
040        }
041    
042    
043    }