public final class

BinaryConstantPool

extends Object
implements Constants
java.lang.Object
   ↳ sun.tools.java.BinaryConstantPool

Class Overview

This class is used to represent a constant table once it is read from a class file. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.

Summary

[Expand]
Inherited Constants
From interface sun.tools.java.Constants
From interface sun.tools.java.RuntimeConstants
[Expand]
Inherited Fields
From interface sun.tools.java.Constants
From interface sun.tools.java.RuntimeConstants
Public Methods
void createIndexHash(Environment env)
Create a hash table of all the items in the constant pool that could possibly be referenced from the outside.
Object getConstant(int n, Environment env)
get the n-th constant from the constant pool
int getConstantType(int n)
get the type of constant given an index
ClassDeclaration getDeclaration(Environment env, int n)
get class declaration
ClassDeclaration getDeclarationFromName(Environment env, int n)
get class declaration
Vector getDependencies(Environment env)
Get a list of dependencies, ie: all the classes referenced in this constant pool.
Identifier getIdentifier(int n)
get an identifier
int getInteger(int n)
get a integer
String getString(int n)
get a string
Type getType(int n)
get a type from a type signature
Object getValue(int n)
get a value
int indexObject(Object obj, Environment env)
Find the index of an Object in the constant pool
int indexString(String string, Environment env)
Find the index of an ascii string in the constant pool.
void write(DataOutputStream out, Environment env)
Write out the contents of the constant pool, including any additions that have been added.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void createIndexHash (Environment env)

Create a hash table of all the items in the constant pool that could possibly be referenced from the outside.

public Object getConstant (int n, Environment env)

get the n-th constant from the constant pool

public int getConstantType (int n)

get the type of constant given an index

public ClassDeclaration getDeclaration (Environment env, int n)

get class declaration

public ClassDeclaration getDeclarationFromName (Environment env, int n)

get class declaration

public Vector getDependencies (Environment env)

Get a list of dependencies, ie: all the classes referenced in this constant pool.

public Identifier getIdentifier (int n)

get an identifier

public int getInteger (int n)

get a integer

public String getString (int n)

get a string

public Type getType (int n)

get a type from a type signature

public Object getValue (int n)

get a value

public int indexObject (Object obj, Environment env)

Find the index of an Object in the constant pool

public int indexString (String string, Environment env)

Find the index of an ascii string in the constant pool. If it's not in the constant pool, then add it at the end.

public void write (DataOutputStream out, Environment env)

Write out the contents of the constant pool, including any additions that have been added.

Throws
IOException