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)
IFieldCollection
Field_info
descriptor at a given offset.get
in interface IFieldCollection
offset
- field offset [must be in [0, size()) range; input not checked]public int[] get(ClassDef cls, java.lang.String name)
IFieldCollection
get
in interface IFieldCollection
cls
- 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()
IFieldCollection
size
in interface IFieldCollection
public java.lang.Object clone()
clone
in interface IFieldCollection
clone
in class java.lang.Object
public void writeInClassFormat(UDataOutputStream out) throws java.io.IOException
writeInClassFormat
in interface IClassFormatOutput
java.io.IOException
public void accept(IClassDefVisitor visitor, java.lang.Object ctx)
accept
in interface IFieldCollection
public int add(Field_info field)
IFieldCollection
add
in interface IFieldCollection
field
- new field descriptor [may not be null]public Field_info set(int offset, Field_info field)
IFieldCollection
set
in interface IFieldCollection
offset
- field offset [must be in [0, size()) range; input not checked]field
- new field descriptor [may not be null]