Package org.jboss.classfilewriter.code
Class TableSwitchBuilder
java.lang.Object
org.jboss.classfilewriter.code.TableSwitchBuilder
builder class used to build a tableswitch statement.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference<BranchEnd> private final CodeLocationprivate final intprivate final intprivate final List<TableSwitchBuilder.ValuePair> -
Constructor Summary
ConstructorsConstructorDescriptionTableSwitchBuilder(int low, int high) Builds a lookup switch statement with no specified default location.TableSwitchBuilder(CodeLocation defaultLocation, int low, int high) Builds a lookup switch statement, specifying the default location -
Method Summary
Modifier and TypeMethodDescriptionadd()Adds a value to the table that is at a location yet to be written.add(CodeLocation location) Adds a value to the tableintgetHigh()intgetLow()
-
Field Details
-
defaultLocation
-
defaultBranchEnd
-
values
-
low
private final int low -
high
private final int high
-
-
Constructor Details
-
TableSwitchBuilder
public TableSwitchBuilder(int low, int high) Builds a lookup switch statement with no specified default location. When the lookup switch is added to the code attribute aBranchEndwill be returned that can be used to set the location.- Parameters:
low-high-
-
TableSwitchBuilder
Builds a lookup switch statement, specifying the default location- Parameters:
defaultLocation- The default locationlow-high-
-
-
Method Details
-
add
Adds a value to the table that is at a location yet to be written. After this lookup switch has been written then the BranchEnd can be retrieved from the returned reference.- Returns:
- A reference to the BranchEnd that will be created.
-
add
Adds a value to the table -
getDefaultLocation
-
getDefaultBranchEnd
-
getValues
-
getLow
public int getLow() -
getHigh
public int getHigh()
-