fr.umlv.corosol.classfile.constant.impl
Class DefaultJConstantInterfaceMethodref

java.lang.Object
  extended by fr.umlv.corosol.classfile.constant.impl.AbstractJConstant
      extended by fr.umlv.corosol.classfile.constant.impl.DefaultJConstantInterfaceMethodref
All Implemented Interfaces:
JConstant, JConstantInterfaceMethodref, JClassFileItem, JObject

public class DefaultJConstantInterfaceMethodref
extends AbstractJConstant
implements JConstantInterfaceMethodref

The default implementation of the JConstantInterfaceMethodref interface.

Author:
Christophe Deleray

Field Summary
 
Fields inherited from interface fr.umlv.corosol.classfile.constant.JConstant
CONSTANT_CLASS, CONSTANT_DOUBLE, CONSTANT_FIELDREF, CONSTANT_FLOAT, CONSTANT_INTEGER, CONSTANT_INTERFACE_METHODREF, CONSTANT_LONG, CONSTANT_METHODREF, CONSTANT_NAME_AND_TYPE, CONSTANT_STRING, CONSTANT_UTF8
 
Constructor Summary
DefaultJConstantInterfaceMethodref()
          Default constructor.
DefaultJConstantInterfaceMethodref(JConstantPool cpool, int classIndex, int nameAndTypeIndex)
          Creates a new Constant_InterfaceMethodref_info entry.
 
Method Summary
 int getClassIndex()
          Returns the index of a CONSTANT_Class_info entry representing a valid fully qualified interface name.
 java.lang.String getClassName()
          Returns the fully qualified interface name of a method
 java.lang.String getDescriptor()
          Returns a method descriptor.
 java.lang.String getName()
          Returns a method name.
 int getNameAndTypeIndex()
          Returns the index of a CONSTANT_NameAndType_info entry representing the name and the descriptor of an interface method.
 JMethod getResolvedMethod()
           
 boolean isResolved()
           
 void readItem(JClassFileInput in)
          Extracts the data of this constant pool entry via the specified input stream.
 void setClassIndex(int classIndex)
          Sets the index of a CONSTANT_Class_info entry representing a valid fully qualified interface name.
 void setNameAndTypeIndex(int nameAndTypeIndex)
          Sets the index of a CONSTANT_NameAndType_info entry representing the name and the descriptor of an interface method.
 void setResolvedMethod(JMethod method)
           
 java.lang.String toString()
          Returns a string representation of this constant pool entry.
 void writeItem(JClassFileOutput out)
          Writes the data of this constant pool entry to a classfile via the specified output stream.
 
Methods inherited from class fr.umlv.corosol.classfile.constant.impl.AbstractJConstant
getConstantPool, getLength, getTag, setConstantPool
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fr.umlv.corosol.classfile.constant.JConstant
getLength, getTag
 
Methods inherited from interface fr.umlv.corosol.classfile.JClassFileItem
getConstantPool, setConstantPool
 

Constructor Detail

DefaultJConstantInterfaceMethodref

public DefaultJConstantInterfaceMethodref()
Default constructor.


DefaultJConstantInterfaceMethodref

public DefaultJConstantInterfaceMethodref(JConstantPool cpool,
                                          int classIndex,
                                          int nameAndTypeIndex)
Creates a new Constant_InterfaceMethodref_info entry.

Parameters:
cpool - the constant pool
classIndex - an index of a Constant_Class_info entry
nameAndTypeIndex - an index of a Constant_NameAndType_info entry
Method Detail

getClassName

public java.lang.String getClassName()
Returns the fully qualified interface name of a method

Specified by:
getClassName in interface JConstantInterfaceMethodref
Returns:
a fully qualified interface name

getName

public java.lang.String getName()
Returns a method name.

Specified by:
getName in interface JConstantInterfaceMethodref
Returns:
a method name

getDescriptor

public java.lang.String getDescriptor()
Returns a method descriptor.

Specified by:
getDescriptor in interface JConstantInterfaceMethodref
Returns:
a method descriptor

getClassIndex

public int getClassIndex()
Returns the index of a CONSTANT_Class_info entry representing a valid fully qualified interface name.

Specified by:
getClassIndex in interface JConstantInterfaceMethodref

getNameAndTypeIndex

public int getNameAndTypeIndex()
Returns the index of a CONSTANT_NameAndType_info entry representing the name and the descriptor of an interface method.

Specified by:
getNameAndTypeIndex in interface JConstantInterfaceMethodref

setClassIndex

public void setClassIndex(int classIndex)
Sets the index of a CONSTANT_Class_info entry representing a valid fully qualified interface name.

Specified by:
setClassIndex in interface JConstantInterfaceMethodref
Parameters:
classIndex - an index of a constant pool entry representing the name of the declaring interface of an interface method

setNameAndTypeIndex

public void setNameAndTypeIndex(int nameAndTypeIndex)
Sets the index of a CONSTANT_NameAndType_info entry representing the name and the descriptor of an interface method.

Specified by:
setNameAndTypeIndex in interface JConstantInterfaceMethodref
Parameters:
nameAndTypeIndex - an index of a constant pool entry representing the name and the descriptor of an interface method

readItem

public void readItem(JClassFileInput in)
              throws java.io.IOException
Extracts the data of this constant pool entry via the specified input stream.

Specified by:
readItem in interface JClassFileItem
Parameters:
in - a class file input stream
Throws:
java.io.IOException - if an I/O error occurs when reading the datas of this constant pool entry

writeItem

public void writeItem(JClassFileOutput out)
               throws java.io.IOException
Writes the data of this constant pool entry to a classfile via the specified output stream.

Specified by:
writeItem in interface JClassFileItem
Parameters:
out - a class file output stream
Throws:
java.io.IOException - if an I/O error occurs when writing into the classfile

toString

public java.lang.String toString()
Returns a string representation of this constant pool entry.

Specified by:
toString in interface JConstant
Specified by:
toString in class AbstractJConstant
Returns:
a string representing this constant pool entry

getResolvedMethod

public JMethod getResolvedMethod()
Specified by:
getResolvedMethod in interface JConstantInterfaceMethodref

setResolvedMethod

public void setResolvedMethod(JMethod method)
Specified by:
setResolvedMethod in interface JConstantInterfaceMethodref

isResolved

public boolean isResolved()
Specified by:
isResolved in interface JConstantInterfaceMethodref