Package com.ibm.wala.dalvik.classLoader
Class InstructionArray
- java.lang.Object
-
- com.ibm.wala.dalvik.classLoader.InstructionArray
-
- All Implemented Interfaces:
Iterable<Instruction>
,Collection<Instruction>
public class InstructionArray extends Object implements Collection<Instruction>
Collection of Instruction wich allow to get an instruction from its table index id or from its bytecode index. It's not allowed to remove an element.
-
-
Constructor Summary
Constructors Constructor Description InstructionArray()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(Instruction e)
boolean
addAll(Collection<? extends Instruction> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
boolean
equals(Object o)
Instruction
getFromId(int id)
Instruction
getFromPc(int pc)
int
getIndexFromPc(int pc)
int
getPcFromIndex(int index)
int
hashCode()
int
indexOf(Object o)
boolean
isEmpty()
Iterator<Instruction>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
Object[]
toArray()
<T> T[]
toArray(T[] a)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Method Detail
-
add
public boolean add(Instruction e)
- Specified by:
add
in interfaceCollection<Instruction>
-
addAll
public boolean addAll(Collection<? extends Instruction> c)
- Specified by:
addAll
in interfaceCollection<Instruction>
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<Instruction>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<Instruction>
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceCollection<Instruction>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection<Instruction>
- Overrides:
hashCode
in classObject
-
indexOf
public int indexOf(Object o)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<Instruction>
-
iterator
public Iterator<Instruction> iterator()
- Specified by:
iterator
in interfaceCollection<Instruction>
- Specified by:
iterator
in interfaceIterable<Instruction>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<Instruction>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<Instruction>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<Instruction>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<Instruction>
-
size
public int size()
- Specified by:
size
in interfaceCollection<Instruction>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<Instruction>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfaceCollection<Instruction>
-
getIndexFromPc
public int getIndexFromPc(int pc)
- Parameters:
pc
- the byte code index.- Returns:
- The index of the instruction of given byte code index
-
getPcFromIndex
public int getPcFromIndex(int index)
- Parameters:
index
- the instruction index.- Returns:
- The byte code address of the instruction index
-
getFromId
public Instruction getFromId(int id)
- Parameters:
id
-- Returns:
- The instruction from its id.
-
getFromPc
public Instruction getFromPc(int pc)
- Parameters:
pc
-- Returns:
- The instruction from its pc.
-
-