serp.bytecode.lowlevel
Class ComplexEntry

java.lang.Object
  extended by serp.bytecode.lowlevel.Entry
      extended by serp.bytecode.lowlevel.ComplexEntry
All Implemented Interfaces:
VisitAcceptor
Direct Known Subclasses:
FieldEntry, InterfaceMethodEntry, MethodEntry

public abstract class ComplexEntry
extends Entry

Base class for field, method, and interface method constant pool entries. All complex entries reference the ClassEntry of the class that owns the entity and a NameAndTypeEntry describing the entity.

Author:
Abe White

Field Summary
 
Fields inherited from class serp.bytecode.lowlevel.Entry
CLASS, DOUBLE, FIELD, FLOAT, INT, INTERFACEMETHOD, LONG, METHOD, NAMEANDTYPE, STRING, UTF8
 
Constructor Summary
ComplexEntry()
          Default constructor.
ComplexEntry(int classIndex, int nameAndTypeIndex)
          Constructor.
 
Method Summary
 ClassEntry getClassEntry()
          Return the referenced ClassEntry.
 int getClassIndex()
          Return the constant pool index of the ClassEntry describing the owning class of this entity.
 NameAndTypeEntry getNameAndTypeEntry()
          Return the referenced NameAndTypeEntry.
 int getNameAndTypeIndex()
          Return the constant pool index of the NameAndTypeEntry describing this entity.
 void setClassIndex(int classIndex)
          Set the constant pool index of the ClassEntry describing the owning class of this entity.
 void setNameAndTypeIndex(int nameAndTypeIndex)
          Set the constant pool index of the NameAndTypeEntry describing this entity.
 
Methods inherited from class serp.bytecode.lowlevel.Entry
create, getIndex, getPool, getType, isWide, read, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface serp.bytecode.visitor.VisitAcceptor
acceptVisit
 

Constructor Detail

ComplexEntry

public ComplexEntry()
Default constructor.


ComplexEntry

public ComplexEntry(int classIndex,
                    int nameAndTypeIndex)
Constructor.

Parameters:
classIndex - the constant pool index of the ClassEntry describing the owner of this entity
nameAndTypeIndex - the constant pool index of the NameAndTypeEntry describing this entity
Method Detail

getClassIndex

public int getClassIndex()
Return the constant pool index of the ClassEntry describing the owning class of this entity. Defaults to 0.


setClassIndex

public void setClassIndex(int classIndex)
Set the constant pool index of the ClassEntry describing the owning class of this entity.


getClassEntry

public ClassEntry getClassEntry()
Return the referenced ClassEntry. This method can only be run for entries that have been added to a constant pool.


getNameAndTypeIndex

public int getNameAndTypeIndex()
Return the constant pool index of the NameAndTypeEntry describing this entity.


setNameAndTypeIndex

public void setNameAndTypeIndex(int nameAndTypeIndex)
Set the constant pool index of the NameAndTypeEntry describing this entity.


getNameAndTypeEntry

public NameAndTypeEntry getNameAndTypeEntry()
Return the referenced NameAndTypeEntry. This method can only be run for entries that have been added to a constant pool.



Copyright © 2002-2007. All Rights Reserved.