001: /*
002: * MethodRef.java Copyright (c) 2006,07 Swaroop Belur
003: *
004: * This program is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU General Public License
006: * as published by the Free Software Foundation; either version 2
007: * of the License, or (at your option) any later version.
008:
009: * This program is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013:
014: * You should have received a copy of the GNU General Public License
015: * along with this program; if not, write to the Free Software
016: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
017: *
018: */
019:
020: package net.sf.jdec.constantpool;
021:
022: public class MethodRef {
023: private int classPointer;
024: private int descriptionPointer;
025: private int tag;
026: private int cppos;
027: private java.lang.String classname = null;
028: private java.lang.String typeofmethod = null;
029: private ClassInfo classinfo = null;
030: private NameAndType nmtype = null;
031: private java.lang.String methodName = null;
032: private java.lang.String key = "";
033:
034: public boolean isMethodRFefForAConstructor() {
035: return key.indexOf("<init>") != -1;
036: }
037:
038: public int getCppos() {
039: return cppos;
040: }
041:
042: public void setCppos(int cppos) {
043: this .cppos = cppos;
044: }
045:
046: public int getTag() {
047: return tag;
048: }
049:
050: public void setTag(int tag) {
051: this .tag = tag;
052: }
053:
054: public int getClassPointer() {
055: return classPointer;
056: }
057:
058: public void setClassPointer(int classPointer) {
059: this .classPointer = classPointer;
060: }
061:
062: public int getDescriptionPointer() {
063: return descriptionPointer;
064: }
065:
066: public void setDescriptionPointer(int descriptionPointer) {
067: this .descriptionPointer = descriptionPointer;
068: }
069:
070: public void setClassName(java.lang.String name) {
071: classname = name;
072: }
073:
074: public void setClassRef(ClassInfo cinfo) {
075: this .classinfo = cinfo;
076: }
077:
078: public void setType(java.lang.String name) {
079: this .typeofmethod = name;
080: }
081:
082: public void setMethodName(java.lang.String methodname) {
083: this .methodName = methodname;
084: }
085:
086: public void setNameAndTypeRef(NameAndType nmtyperef) {
087: this .nmtype = nmtyperef;
088: }
089:
090: public NameAndType getNameAndTypeRef() {
091: return this .nmtype;
092: }
093:
094: public java.lang.String getKey() {
095: if (methodName.equals("<init>"))
096: methodName = this .getClassname();
097: return typeofmethod + methodName;
098: }
099:
100: public void setKey(java.lang.String key) {
101: this .key = key;
102: }
103:
104: public java.lang.String getClassname() {
105: return classname;
106: }
107:
108: public java.lang.String getMethodName() {
109: // if(methodName.equals("<init>"))methodName=classname.replace('/','.');
110: return methodName;
111: }
112:
113: public java.lang.String getTypeofmethod() {
114: return typeofmethod;
115: }
116:
117: public void setTypeofmethod(java.lang.String typeofmethod) {
118: this.typeofmethod = typeofmethod;
119: }
120:
121: }
|