final class FieldCollection extends java.lang.Object implements IFieldCollection
| Modifier and Type | Field and Description |
|---|---|
private java.util.List |
m_fields |
| Constructor and Description |
|---|
FieldCollection(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(IClassDefVisitor visitor,
java.lang.Object ctx) |
int |
add(Field_info field)
Adds a new Field_info descriptor to this collection.
|
java.lang.Object |
clone()
Performs a deep copy.
|
int[] |
get(ClassDef cls,
java.lang.String name)
Returns an array of offsets for fields named 'name' (empty array if no
matching fields found).
|
Field_info |
get(int offset)
Returns
Field_info descriptor at a given offset. |
Field_info |
set(int offset,
Field_info field)
Replaces the Field_info descriptor at a given offset.
|
int |
size()
Returns the number of fields in this collection [can be 0].
|
void |
writeInClassFormat(UDataOutputStream out) |
public Field_info get(int offset)
IFieldCollectionField_info descriptor at a given offset.get in interface IFieldCollectionoffset - field offset [must be in [0, size()) range; input not checked]public int[] get(ClassDef cls, java.lang.String name)
IFieldCollectionget in interface IFieldCollectioncls - class definition providing the constant pool against which to
resolve names [may not be null]name - field name [null or empty will result in no matches]public int size()
IFieldCollectionsize in interface IFieldCollectionpublic java.lang.Object clone()
clone in interface IFieldCollectionclone in class java.lang.Objectpublic void writeInClassFormat(UDataOutputStream out) throws java.io.IOException
writeInClassFormat in interface IClassFormatOutputjava.io.IOExceptionpublic void accept(IClassDefVisitor visitor, java.lang.Object ctx)
accept in interface IFieldCollectionpublic int add(Field_info field)
IFieldCollectionadd in interface IFieldCollectionfield - new field descriptor [may not be null]public Field_info set(int offset, Field_info field)
IFieldCollectionset in interface IFieldCollectionoffset - field offset [must be in [0, size()) range; input not checked]field - new field descriptor [may not be null]