Methods Summary |
---|
public void | accept(IClassDefVisitor visitor, java.lang.Object ctx)
|
public int | add(CONSTANT_info constant)Appends 'constant' to the end of the collection. No duplicate checks
are made.
|
public java.lang.Object | clone()
|
public int | find(int type, com.vladium.jcd.cls.IConstantCollection$IConstantComparator comparator)Searches the pool for a matching constant of given type with equality
semantics expressed by 'comparator'. This method guarantees that
when comparator.equals(c) is called c.type() is 'type'. The cost is
O(pool size). When multiple matches exist, the location of the first one
found will be returned (chosen in some indeterministic way).
|
public int | findCONSTANT_Utf8(java.lang.String value)Convenience method that can lookup CONSTANT_Utf8 entries in O(1) time
on average. Note that .class format does not guarantee that all such
entries are not duplicated in the pool. When multiple matches exist, the
location of the first one found will be returned (chosen in some
indeterministic way).
|
public CONSTANT_info | get(int index)Returns a CONSTANT_info at a given pool index. Note that 'index' is
1-based [the way an index would be embedded in bytecode instructions].
Note that because CONSTANT_Long and CONSTANT_Double entries occupy
two consequitive index slots certain index values inside the valid range
can be invalid; use {@link #iterator()} to iterate only over valid entries
in a transparent fashion.
|
public com.vladium.jcd.cls.IConstantCollection$IConstantIterator | iterator()Returns a fail-fast iterator over all valid entries in the pool. The
resulting object would be invalidated by simultaneous mutation to the
underlying collection pool.
|
public CONSTANT_info | set(int index, CONSTANT_info constant)Replaces an existing constant pool entry. A replacement can be made only
for a constant of the same width as the constant currently occupying the
slot.
|
public int | size()Returns the number of CONSTANT_info entries in this collection.
|