Class AndroidEntryPoint.ExecutionOrder
- java.lang.Object
-
- com.ibm.wala.dalvik.ipa.callgraph.impl.AndroidEntryPoint.ExecutionOrder
-
- All Implemented Interfaces:
AndroidEntryPoint.IExecutionOrder
,Comparable<AndroidEntryPoint.IExecutionOrder>
- Enclosing class:
- AndroidEntryPoint
public static class AndroidEntryPoint.ExecutionOrder extends Object implements Comparable<AndroidEntryPoint.IExecutionOrder>, AndroidEntryPoint.IExecutionOrder
The ExecutionOrder is used to partially order EntryPoints. The order has to be understood inclusive! E.g. "after(END_OF_LOOP)" means that the position is __BEFORE__ the loop is actually closed! Before building the model a list of AdroidEntryPoints is to be sorted by that criterion. You can use AndroidEntryPoint.ExecutionOrderComperator for that task.
-
-
Field Summary
Fields Modifier and Type Field Description static AndroidEntryPoint.ExecutionOrder
AFTER_LOOP
Basicly the same as AT_LAST but visited beforestatic AndroidEntryPoint.ExecutionOrder
AT_FIRST
Visit the EntryPoint once at the beginning of the model use that for initialization stuffstatic AndroidEntryPoint.ExecutionOrder
AT_LAST
Last calls in the modelstatic AndroidEntryPoint.ExecutionOrder
BEFORE_LOOP
Basicly the same as AT_FIRST but visited after AT_FIRSTstatic AndroidEntryPoint.ExecutionOrder
DEFAULT
This value getts used by the detection heuristic - It is not recommended for manual use.static AndroidEntryPoint.ExecutionOrder
END_OF_LOOP
Things in END_OF_LOOP are acutually part of the loop.static AndroidEntryPoint.ExecutionOrder
MIDDLE_OF_LOOP
Basicly the same as START_OF_LOOPstatic AndroidEntryPoint.ExecutionOrder
MULTIPLE_TIMES_IN_LOOP
Do multiple calls in the loop.static AndroidEntryPoint.ExecutionOrder
START_OF_LOOP
Visit multiple times (endless) in the loop
-
Constructor Summary
Constructors Constructor Description ExecutionOrder(int val)
Unrecommended way to generate the Order based on an Integer.ExecutionOrder(String label)
Unrecommended way to generate the Order based on a Label-String.
-
Method Summary
-
-
-
Field Detail
-
AT_FIRST
public static final AndroidEntryPoint.ExecutionOrder AT_FIRST
Visit the EntryPoint once at the beginning of the model use that for initialization stuff
-
BEFORE_LOOP
public static final AndroidEntryPoint.ExecutionOrder BEFORE_LOOP
Basicly the same as AT_FIRST but visited after AT_FIRST
-
START_OF_LOOP
public static final AndroidEntryPoint.ExecutionOrder START_OF_LOOP
Visit multiple times (endless) in the loop
-
MIDDLE_OF_LOOP
public static final AndroidEntryPoint.ExecutionOrder MIDDLE_OF_LOOP
Basicly the same as START_OF_LOOP
-
MULTIPLE_TIMES_IN_LOOP
public static final AndroidEntryPoint.ExecutionOrder MULTIPLE_TIMES_IN_LOOP
Do multiple calls in the loop. Visited after MIDDLE_OF_LOOP, before EEN_OF_LOOP
-
END_OF_LOOP
public static final AndroidEntryPoint.ExecutionOrder END_OF_LOOP
Things in END_OF_LOOP are acutually part of the loop. Use AFTER_LOOP if you want them executed only once
-
AFTER_LOOP
public static final AndroidEntryPoint.ExecutionOrder AFTER_LOOP
Basicly the same as AT_LAST but visited before
-
AT_LAST
public static final AndroidEntryPoint.ExecutionOrder AT_LAST
Last calls in the model
-
DEFAULT
public static final AndroidEntryPoint.ExecutionOrder DEFAULT
This value getts used by the detection heuristic - It is not recommended for manual use.
-
-
Constructor Detail
-
ExecutionOrder
public ExecutionOrder(int val)
Unrecommended way to generate the Order based on an Integer. This method is handy when reading back files. In your code you should prefer the methodsafter(IExecutionOrder)
andbetween(IExecutionOrder, IExecutionOrder)
.
-
ExecutionOrder
public ExecutionOrder(String label)
Unrecommended way to generate the Order based on a Label-String. This method is handy when reading back files. If you want to refer to a label you should prefer the static members.
-
-
Method Detail
-
getOrderValue
public int getOrderValue()
Returns an integer-representation of the ExecutionOrder.- Specified by:
getOrderValue
in interfaceAndroidEntryPoint.IExecutionOrder
-
between
public static AndroidEntryPoint.ExecutionOrder between(AndroidEntryPoint.IExecutionOrder after, AndroidEntryPoint.IExecutionOrder before)
Use this to place a call to an EntryPoint between two other EntryPoint calls or ExecutionOrder "labels". between() does not care about section-boundaries by itself! Usebetween(com.ibm.wala.dalvik.ipa.callgraph.impl.AndroidEntryPoint.IExecutionOrder[],com.ibm.wala.dalvik.ipa.callgraph.impl.AndroidEntryPoint.IExecutionOrder[])
and use labels as additional placement-information to prevent unexpected misplacement.- Parameters:
after
- the call or "label" to be executed before this onebefore
- the call or "label" to be executed after this one (inclusive)- Returns:
- A sortable object to represent the execution order
- Throws:
ArithmeticException
- when the precision is no more suitable for further cascadingIllegalArgumentException
- if parameter after is larger than before.NullPointerException
- if either parameter is null
-
between
public static AndroidEntryPoint.ExecutionOrder between(AndroidEntryPoint.IExecutionOrder[] after, AndroidEntryPoint.IExecutionOrder[] before)
Use this variant to refer to multiple locations. The minimum / maximum is computed before the placement of the ExecutionOrder. This method is intended to be more robust when changing the position-information of referred-to ExecutionOrders. In any other means it behaves exactly likebetween(IExecutionOrder, IExecutionOrder)
.- Parameters:
after
- the calls or "labels" to be executed before this onebefore
- the calls or "labels" to be executed after this one (inclusive)- Returns:
- A sortable object to represent the execution order
- Throws:
ArithmeticException
- when the precision is no more suitable for further cascadingIllegalArgumentException
- if parameter after is larger than before.NullPointerException
- if either parameter is null
-
between
public static AndroidEntryPoint.ExecutionOrder between(AndroidEntryPoint.IExecutionOrder after, AndroidEntryPoint.IExecutionOrder[] before)
-
between
public static AndroidEntryPoint.ExecutionOrder between(AndroidEntryPoint.IExecutionOrder[] after, AndroidEntryPoint.IExecutionOrder before)
-
after
public static AndroidEntryPoint.ExecutionOrder after(AndroidEntryPoint.IExecutionOrder after)
Place the call in the same section after the given call or "label".- Parameters:
after
- the call to be executed before this one or label the call belongs to- Returns:
- A sortable object to represent the execution order
- Throws:
ArithmeticException
- when the precision is no more suitable for further cascadingNullPointerException
- if the parameter is null
-
after
public static AndroidEntryPoint.ExecutionOrder after(int after)
Preferafter(IExecutionOrder)
whenever possible.
-
after
public static AndroidEntryPoint.ExecutionOrder after(AndroidEntryPoint.IExecutionOrder[] after)
Use this variant to refer to multiple locations. The maximum is computed before the placement of the ExecutionOrder.- Parameters:
after
- the call to be executed before this one or label the call belongs to- Returns:
- A sortable object to represent the execution order
- Throws:
ArithmeticException
- when the precision is no more suitable for further cascadingNullPointerException
- if the parameter is null
-
directlyBefore
public static AndroidEntryPoint.ExecutionOrder directlyBefore(AndroidEntryPoint.IExecutionOrder before)
-
directlyAfter
public static AndroidEntryPoint.ExecutionOrder directlyAfter(AndroidEntryPoint.IExecutionOrder before)
-
getSection
public AndroidEntryPoint.ExecutionOrder getSection()
AbstractAndroidModel inserts code at section switches. There are eight hardcoded sections. Sections are derived by rounding the integer-representation.- Specified by:
getSection
in interfaceAndroidEntryPoint.IExecutionOrder
- Returns:
- the section of this entity
-
compareTo
public int compareTo(AndroidEntryPoint.IExecutionOrder o)
- Specified by:
compareTo
in interfaceComparable<AndroidEntryPoint.IExecutionOrder>
-
-