Top Description Inners Fields Constructors Methods
org.jboss.classfilewriter.code

public Class TableSwitchBuilder

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, java.util.concurrent.atomic.AtomicReference

builder class used to build a tableswitch statement.
Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final AtomicReference<BranchEnd>
private final CodeLocation
private final int
private final int
private final List<TableSwitchBuilder.ValuePair>

Constructor Summary

AccessConstructor and Description
public
TableSwitchBuilder(final int low, final int high)

Builds a lookup switch statement with no specified default location.

public
TableSwitchBuilder(final CodeLocation
The default location
defaultLocation
,
final int low, final int high)

Builds a lookup switch statement, specifying the default location

Method Summary

Modifier and TypeMethod and Description
public AtomicReference<BranchEnd>

Returns:

A reference to the BranchEnd that will be created.
add
()

Adds a value to the table that is at a location yet to be written.

public TableSwitchBuilder
add(final CodeLocation location)

Adds a value to the table

public AtomicReference<BranchEnd>
public CodeLocation
public int
public int
public List<TableSwitchBuilder.ValuePair>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultBranchEndback to summary
private final AtomicReference<BranchEnd> defaultBranchEnd
defaultLocationback to summary
private final CodeLocation defaultLocation
highback to summary
private final int high
lowback to summary
private final int low
valuesback to summary
private final List<TableSwitchBuilder.ValuePair> values

Constructor Detail

TableSwitchBuilderback to summary
public TableSwitchBuilder(final int low, final int high)

Builds a lookup switch statement with no specified default location. When the lookup switch is added to the code attribute a org.jboss.classfilewriter.code.BranchEnd will be returned that can be used to set the location.

TableSwitchBuilderback to summary
public TableSwitchBuilder(final CodeLocation defaultLocation, final int low, final int high)

Builds a lookup switch statement, specifying the default location

Parameters
defaultLocation:CodeLocation

The default location

Method Detail

addback to summary
public AtomicReference<BranchEnd> 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:AtomicReference<BranchEnd>

A reference to the BranchEnd that will be created.

addback to summary
public TableSwitchBuilder add(final CodeLocation location)

Adds a value to the table

getDefaultBranchEndback to summary
public AtomicReference<BranchEnd> getDefaultBranchEnd()
getDefaultLocationback to summary
public CodeLocation getDefaultLocation()
getHighback to summary
public int getHigh()
getLowback to summary
public int getLow()
getValuesback to summary
public List<TableSwitchBuilder.ValuePair> getValues()
org.jboss.classfilewriter.code back to summary

public Class TableSwitchBuilder.ValuePair

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final AtomicReference<BranchEnd>
private final CodeLocation

Constructor Summary

AccessConstructor and Description
public
public
ValuePair(final CodeLocation location)

Method Summary

Modifier and TypeMethod and Description
public AtomicReference<BranchEnd>
public CodeLocation
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

branchEndback to summary
private final AtomicReference<BranchEnd> branchEnd
locationback to summary
private final CodeLocation location

Constructor Detail

ValuePairback to summary
public ValuePair(final AtomicReference<BranchEnd> branchEnd)
ValuePairback to summary
public ValuePair(final CodeLocation location)

Method Detail

getBranchEndback to summary
public AtomicReference<BranchEnd> getBranchEnd()
getLocationback to summary
public CodeLocation getLocation()