|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vladium.jcd.cls.ConstantCollection
final class ConstantCollection
| Nested Class Summary | |
|---|---|
private static class |
ConstantCollection.ConstantIterator
|
| Nested classes/interfaces inherited from interface com.vladium.jcd.cls.IConstantCollection |
|---|
IConstantCollection.IConstantComparator, IConstantCollection.IConstantIterator |
| Field Summary | |
|---|---|
private ObjectIntMap |
m_CONSTANT_Utf8_index
|
private java.util.List |
m_constants
|
private int |
m_size
|
| Constructor Summary | |
|---|---|
ConstantCollection(int capacity)
|
|
| Method Summary | |
|---|---|
void |
accept(IClassDefVisitor visitor,
java.lang.Object ctx)
|
int |
add(CONSTANT_info constant)
Appends 'constant' to the end of the collection. |
java.lang.Object |
clone()
Performs a deep copy. |
int |
find(int type,
IConstantCollection.IConstantComparator comparator)
Searches the pool for a matching constant of given type with equality semantics expressed by 'comparator'. |
int |
findCONSTANT_Utf8(java.lang.String value)
Convenience method that can lookup CONSTANT_Utf8 entries in O(1) time on average. |
CONSTANT_info |
get(int index)
Returns a CONSTANT_info at a given pool index. |
private ObjectIntMap |
getCONSTANT_Utf8_index()
|
IConstantCollection.IConstantIterator |
iterator()
Returns a fail-fast iterator over all valid entries in the pool. |
CONSTANT_info |
set(int index,
CONSTANT_info constant)
Replaces an existing constant pool entry. |
int |
size()
Returns the number of CONSTANT_info entries in this collection. |
void |
writeInClassFormat(UDataOutputStream out)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.List m_constants
private int m_size
private transient ObjectIntMap m_CONSTANT_Utf8_index
| Constructor Detail |
|---|
ConstantCollection(int capacity)
| Method Detail |
|---|
public CONSTANT_info get(int index)
IConstantCollectionIConstantCollection.iterator() to iterate only over valid entries
in a transparent fashion.
get in interface IConstantCollectionindex - constant pool index [must be in [1, size()] range]
public IConstantCollection.IConstantIterator iterator()
IConstantCollection
iterator in interface IConstantCollection
public int find(int type,
IConstantCollection.IConstantComparator comparator)
IConstantCollection
find in interface IConstantCollectiontype - type of constants to filter by [not validated]comparator - [may not be null]
public int findCONSTANT_Utf8(java.lang.String value)
IConstantCollection
findCONSTANT_Utf8 in interface IConstantCollectionvalue - string value on which to match [may not be null]
public int size()
IConstantCollection
size in interface IConstantCollectionpublic java.lang.Object clone()
clone in interface IConstantCollectionclone in class java.lang.Object
public void writeInClassFormat(UDataOutputStream out)
throws java.io.IOException
writeInClassFormat in interface IClassFormatOutputjava.io.IOException
public void accept(IClassDefVisitor visitor,
java.lang.Object ctx)
accept in interface IConstantCollection
public CONSTANT_info set(int index,
CONSTANT_info constant)
IConstantCollection
set in interface IConstantCollectionindex - constant pool index [must be in [1, size()] range]constant - new entry to set [may not be null; input unchecked]
public int add(CONSTANT_info constant)
IConstantCollection
add in interface IConstantCollectionconstant - new constant [may not be null; input unchecked]
private ObjectIntMap getCONSTANT_Utf8_index()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||