| java.lang.Object org.apache.harmony.pack200.SegmentConstantPool
SegmentConstantPool | public class SegmentConstantPool (Code) | | |
Method Summary | |
public ConstantPoolEntry | getClassPoolEntry(String name) Given the name of a class, answer the CPClass associated
with that class. | public ConstantPoolEntry | getClassSpecificPoolEntry(int cp, long desiredIndex, String desiredClassName) Subset the constant pool of the specified type
to be just that which has the specified class
name. | public ConstantPoolEntry | getConstantPoolEntry(int cp, long value) | public ConstantPoolEntry[] | getCpAll() | public ConstantPoolEntry | getInitMethodPoolEntry(int cp, long value, String desiredClassName) Answer the init method for the specified class. | public Object | getValue(int cp, long value) | protected int | matchSpecificPoolEntryIndex(String[] nameArray, String compareString, int desiredIndex) A number of things make use of subsets of structures.
In one particular example, _super bytecodes will use a subset
of method or field classes which have just those methods /
fields defined in the superclass. | protected int | matchSpecificPoolEntryIndex(String[] primaryArray, String[] secondaryArray, String primaryCompareString, String secondaryCompareRegex, int desiredIndex) This method's function is to look through pairs of arrays. |
ALL | final public static int ALL(Code) | | |
CP_CLASS | final public static int CP_CLASS(Code) | | |
CP_DESCR | final public static int CP_DESCR(Code) | | |
CP_DOUBLE | final public static int CP_DOUBLE(Code) | | |
CP_FIELD | final public static int CP_FIELD(Code) | | |
CP_FLOAT | final public static int CP_FLOAT(Code) | | |
CP_IMETHOD | final public static int CP_IMETHOD(Code) | | |
CP_INT | final public static int CP_INT(Code) | | |
CP_LONG | final public static int CP_LONG(Code) | | |
CP_METHOD | final public static int CP_METHOD(Code) | | |
CP_STRING | final public static int CP_STRING(Code) | | |
SIGNATURE | final public static int SIGNATURE(Code) | | |
UTF_8 | final public static int UTF_8(Code) | | |
SegmentConstantPool | public SegmentConstantPool(CpBands bands)(Code) | | Parameters: bands - |
getClassPoolEntry | public ConstantPoolEntry getClassPoolEntry(String name)(Code) | | Given the name of a class, answer the CPClass associated
with that class. Answer null if the class doesn't exist.
Parameters: name - Class name to look for (form: java/lang/Object) CPClass for that class name, or null if not found. |
getClassSpecificPoolEntry | public ConstantPoolEntry getClassSpecificPoolEntry(int cp, long desiredIndex, String desiredClassName) throws Pack200Exception(Code) | | Subset the constant pool of the specified type
to be just that which has the specified class
name. Answer the ConstantPoolEntry at the
desiredIndex of the subsetted pool.
Parameters: cp - type of constant pool array to search Parameters: desiredIndex - index of the constant pool Parameters: desiredClassName - class to use to generate asubset of the pool ConstantPoolEntry throws: Pack200Exception - |
getInitMethodPoolEntry | public ConstantPoolEntry getInitMethodPoolEntry(int cp, long value, String desiredClassName) throws Pack200Exception(Code) | | Answer the init method for the specified class.
Parameters: cp - constant pool to search (must be CP_METHOD) Parameters: value - index of init method Parameters: desiredClassName - String class name of the init method CPMethod init method throws: Pack200Exception - |
matchSpecificPoolEntryIndex | protected int matchSpecificPoolEntryIndex(String[] nameArray, String compareString, int desiredIndex)(Code) | | A number of things make use of subsets of structures.
In one particular example, _super bytecodes will use a subset
of method or field classes which have just those methods /
fields defined in the superclass. Similarly, _this bytecodes
use just those methods/fields defined in this class, and _init
bytecodes use just those methods that start with .
This method takes an array of names, a String to match for,
an index and a boolean as parameters, and answers the array
position in the array of the indexth element which matches
(or equals) the String (depending on the state of the boolean)
In other words, if the class array consists of:
Object [position 0, 0th instance of Object]
String [position 1, 0th instance of String]
String [position 2, 1st instance of String]
Object [position 3, 1st instance of Object]
Object [position 4, 2nd instance of Object]
then matchSpecificPoolEntryIndex(..., "Object", 2, false) will
answer 4. matchSpecificPoolEntryIndex(..., "String", 0, false)
will answer 1.
Parameters: nameArray - Array of Strings against which the compareString is tested Parameters: compareString - String for which to search Parameters: desiredIndex - nth element with that match (counting from 0) int index into nameArray, or -1 if not found. |
matchSpecificPoolEntryIndex | protected int matchSpecificPoolEntryIndex(String[] primaryArray, String[] secondaryArray, String primaryCompareString, String secondaryCompareRegex, int desiredIndex)(Code) | | This method's function is to look through pairs of arrays.
It keeps track of the number of hits it finds using the
following basis of comparison for a hit:
- the primaryArray[index] must be .equals() to the primaryCompareString
- the secondaryArray[index] .matches() the secondaryCompareString
When the desiredIndex number of hits has been reached, the index
into the original two arrays of the element hit is returned.
Parameters: primaryArray - The first array to search Parameters: secondaryArray - The second array (must be same .length as primaryArray) Parameters: primaryCompareString - The String to compare against primaryArray using .equals() Parameters: secondaryCompareRegex - The String to compare against secondaryArray using .matches() Parameters: desiredIndex - The nth hit whose position we're seeking int index that represents the position of the nth hit in primaryArray and secondaryArray |
|
|