sysModel.classFile.constantPool
Class NameAndTypePoolInfo

java.lang.Object
  extended by sysModel.classFile.constantPool.APoolInfo
      extended by sysModel.classFile.constantPool.NameAndTypePoolInfo

public class NameAndTypePoolInfo
extends APoolInfo

Represents a name-and-type object in the constant pool.

Author:
Mathias Ricken

Field Summary
protected  AUTFPoolInfo _descriptor
          Type descriptor information.
protected  short _descriptorIndex
          Type descriptor index.
protected  AUTFPoolInfo _name
          Name information.
protected  short _nameIndex
          Name index.
 
Fields inherited from class sysModel.classFile.constantPool.APoolInfo
_constantPool, _type, CONSTANT_Class, CONSTANT_Double, CONSTANT_Fieldref, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodref, CONSTANT_Long, CONSTANT_Methodref, CONSTANT_NameAndType, CONSTANT_String, CONSTANT_Utf8_ASCII, CONSTANT_Utf8_Unicode
 
Constructor Summary
NameAndTypePoolInfo(AUTFPoolInfo name, AUTFPoolInfo descriptor, ConstantPool cp)
          Constructor.
NameAndTypePoolInfo(java.io.DataInputStream dis, ConstantPool cp)
          Constructor reading from a stream.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this object and another one.
<R,D> R
execute(IPoolInfoVisitor<R,D> visitor, D data)
          Execute a visitor.
 AUTFPoolInfo getDescriptor()
          Accessor for the type descriptor information.
 AUTFPoolInfo getName()
          Accessor for the name information.
 int hashCode()
          Return a hash code.
 void reindex()
          Reindex constant pool indices.
 void resolve()
          Resolve constant pool objects.
 void setDescriptor(AUTFPoolInfo descriptor)
          Mutator for the type descriptor information.
 void setName(AUTFPoolInfo name)
          Mutator for the name information.
 java.lang.String toString()
          Return a human-readable version of this constant pool object.
 java.lang.String toStringVerbose()
          Return a human-readable version of this constant pool object.
 void write(java.io.DataOutputStream dos)
          Write this constant pool object into the stream, including the type byte.
 
Methods inherited from class sysModel.classFile.constantPool.APoolInfo
inPool, read
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_name

protected AUTFPoolInfo _name
Name information.


_descriptor

protected AUTFPoolInfo _descriptor
Type descriptor information.


_nameIndex

protected short _nameIndex
Name index.


_descriptorIndex

protected short _descriptorIndex
Type descriptor index.

Constructor Detail

NameAndTypePoolInfo

public NameAndTypePoolInfo(AUTFPoolInfo name,
                           AUTFPoolInfo descriptor,
                           ConstantPool cp)
Constructor.

Parameters:
name - name information
descriptor - type descriptor information

NameAndTypePoolInfo

public NameAndTypePoolInfo(java.io.DataInputStream dis,
                           ConstantPool cp)
                    throws java.io.IOException
Constructor reading from a stream.

Parameters:
dis - input stream
cp - constant pool
Throws:
java.io.IOException
Method Detail

getName

public AUTFPoolInfo getName()
Accessor for the name information.

Returns:
name information

setName

public void setName(AUTFPoolInfo name)
Mutator for the name information.

Parameters:
name - new name information

getDescriptor

public AUTFPoolInfo getDescriptor()
Accessor for the type descriptor information.

Returns:
type descriptor information

setDescriptor

public void setDescriptor(AUTFPoolInfo descriptor)
Mutator for the type descriptor information.

Parameters:
descriptor - type descriptor information

write

public void write(java.io.DataOutputStream dos)
           throws java.io.IOException
Write this constant pool object into the stream, including the type byte.

Specified by:
write in class APoolInfo
Parameters:
dos - stream
Throws:
java.io.IOException

resolve

public void resolve()
Resolve constant pool objects. This makes sure that the object links match the index links.

Specified by:
resolve in class APoolInfo

reindex

public void reindex()
Reindex constant pool indices. This makes sure the index links match the object links.

Specified by:
reindex in class APoolInfo

toString

public java.lang.String toString()
Return a human-readable version of this constant pool object.

Specified by:
toString in class APoolInfo
Returns:
string

toStringVerbose

public java.lang.String toStringVerbose()
Return a human-readable version of this constant pool object.

Specified by:
toStringVerbose in class APoolInfo
Returns:
string

hashCode

public int hashCode()
Return a hash code.

Specified by:
hashCode in class APoolInfo
Returns:
hash code

equals

public boolean equals(java.lang.Object obj)
Compare this object and another one.

Specified by:
equals in class APoolInfo
Parameters:
obj - other object
Returns:
true if the same

execute

public <R,D> R execute(IPoolInfoVisitor<R,D> visitor,
                       D data)
Execute a visitor.

Specified by:
execute in class APoolInfo
Parameters:
visitor - visitor
data - visitor-specific parameter
Returns:
visitor-specific return value