com.sun.tools.javac.jvm
Class Pool

java.lang.Object
  extended by com.sun.tools.javac.jvm.Pool

public class Pool
extends java.lang.Object

An internal structure that corresponds to the constant pool of a classfile.

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Nested Class Summary
(package private) static class Pool.Method
           
(package private) static class Pool.Variable
           
 
Field Summary
(package private)  java.util.Map<java.lang.Object,java.lang.Integer> indices
          A hashtable containing all constants in the pool.
static int MAX_ENTRIES
           
static int MAX_STRING_LENGTH
           
(package private)  java.lang.Object[] pool
          The initial pool buffer.
(package private)  int pp
          Index of next constant to be entered.
 
Constructor Summary
Pool()
          Construct an empty pool.
Pool(int pp, java.lang.Object[] pool)
          Construct a pool with given number of elements and element array.
 
Method Summary
private  void doublePool()
          Double pool buffer in size.
 int get(java.lang.Object o)
          Return the given object's index in the pool, or -1 if object is not in there.
 int numEntries()
          Return the number of entries in the constant pool.
 int put(java.lang.Object value)
          Place an object in the pool, unless it is already there.
 void reset()
          Remove everything from this pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ENTRIES

public static final int MAX_ENTRIES
See Also:
Constant Field Values

MAX_STRING_LENGTH

public static final int MAX_STRING_LENGTH
See Also:
Constant Field Values

pp

int pp
Index of next constant to be entered.


pool

java.lang.Object[] pool
The initial pool buffer.


indices

java.util.Map<java.lang.Object,java.lang.Integer> indices
A hashtable containing all constants in the pool.

Constructor Detail

Pool

public Pool(int pp,
            java.lang.Object[] pool)
Construct a pool with given number of elements and element array.


Pool

public Pool()
Construct an empty pool.

Method Detail

numEntries

public int numEntries()
Return the number of entries in the constant pool.


reset

public void reset()
Remove everything from this pool.


doublePool

private void doublePool()
Double pool buffer in size.


put

public int put(java.lang.Object value)
Place an object in the pool, unless it is already there. If object is a symbol also enter its owner unless the owner is a package. Return the object's index in the pool.


get

public int get(java.lang.Object o)
Return the given object's index in the pool, or -1 if object is not in there.