Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.rop.code

public final Class RegisterSpecList

extends FixedSizeList
implements TypeList
Class Inheritance
All Implemented Interfaces
org.droidparts.dexmaker.dx.rop.type.TypeList
Imports
org.droidparts.dexmaker.dx.rop.type.Type, .TypeList, org.droidparts.dexmaker.dx.util.FixedSizeList, java.util.BitSet

List of RegisterSpec instances.

Field Summary

Modifier and TypeField and Description
public static final RegisterSpecList
EMPTY

non-null; no-element instance

Constructor Summary

AccessConstructor and Description
public
RegisterSpecList(int
the size of the list
size
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
public RegisterSpec

Returns:

non-null; the indicated element
get
(int
>= 0, < size(); which element
n
)

Gets the indicated element.

public int

Returns:

>= 0; the required registers size
getRegistersSize
()

Gets the minimum required register count implied by this instance.

public Type
getType(int
>= 0, < size(); which element
n
)

Implements org.droidparts.dexmaker.dx.rop.type.TypeList.getType.

Gets the indicated element.
public int
getWordCount()

Implements org.droidparts.dexmaker.dx.rop.type.TypeList.getWordCount.

Gets the number of 32-bit words required to hold instances of all the elements of this list.
public int

Returns:

index of RegisterSpec or -1
indexOfRegister
(int
Register to find
reg
)

Returns the index of a RegisterSpec in this list that uses the specified register, or -1 if none in this list uses the register.

public static RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
make
(RegisterSpec
non-null; the element
spec
)

Makes a single-element instance.

public static RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
make
(RegisterSpec
non-null; the first element
spec0
,
RegisterSpec
non-null; the second element
spec1
)

Makes a two-element instance.

public static RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
make
(RegisterSpec
non-null; the first element
spec0
,
RegisterSpec
non-null; the second element
spec1
,
RegisterSpec
non-null; the third element
spec2
)

Makes a three-element instance.

public static RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
make
(RegisterSpec
non-null; the first element
spec0
,
RegisterSpec
non-null; the second element
spec1
,
RegisterSpec
non-null; the third element
spec2
,
RegisterSpec
non-null; the fourth element
spec3
)

Makes a four-element instance.

public void
set(int
>= 0, < size(); which element
n
,
RegisterSpec
non-null; the value to store
spec
)

Sets the element at the given index.

public RegisterSpec

Returns:

RegisterSpec that uses argument or null.
specForRegister
(int
Register to find
reg
)

Returns a RegisterSpec in this list that uses the specified register, or null if there is none in this list.

public RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
subset
(BitSet
non-null; set of registers to exclude
exclusionSet
)

Returns a new instance, which contains a subset of the elements specified by the given BitSet.

public TypeList
withAddedType(Type
non-null; item to append
type
)

Implements org.droidparts.dexmaker.dx.rop.type.TypeList.withAddedType.

Returns a new instance which is identical to this one, except that the given item is appended to the end and it is guaranteed to be immutable.
public RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
withExpandedRegisters
(int
the base register number
base
,
boolean
whether to duplicate the first number
duplicateFirst
,
BitSet
null-ok; either a non-null set of compatible registers, or null to indicate all registers are compatible
compatRegs
)

Returns an instance that is identical to this one, except that all incompatible register numbers are renumbered sequentially from the given base, with the first number duplicated if indicated.

public RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
withFirst
(RegisterSpec
non-null; the new first spec (to prepend)
spec
)

Returns a new instance, which is the same as this instance, except that it has an additional element prepended to the original.

public RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
withOffset
(int
the amount to offset the register numbers by
delta
)

Returns an instance that is identical to this one, except that all register numbers are offset by the given amount.

public RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
withoutFirst
()

Returns a new instance, which is the same as this instance, except that its first element is removed.

public RegisterSpecList

Returns:

non-null; an appropriately-constructed instance
withoutLast
()

Returns a new instance, which is the same as this instance, except that its last element is removed.

Inherited from org.droidparts.dexmaker.dx.util.FixedSizeList:
equalsget0getOrNull0hashCodeset0shrinkToFitsizetoHumantoHumantoStringtoString

Field Detail

EMPTYback to summary
public static final RegisterSpecList EMPTY

non-null; no-element instance

Constructor Detail

RegisterSpecListback to summary
public RegisterSpecList(int size)

Constructs an instance. All indices initially contain null.

Parameters
size:int

the size of the list

Method Detail

getback to summary
public RegisterSpec get(int n)

Gets the indicated element. It is an error to call this with the index for an element which was never set; if you do that, this will throw NullPointerException.

Parameters
n:int

>= 0, < size(); which element

Returns:RegisterSpec

non-null; the indicated element

getRegistersSizeback to summary
public int getRegistersSize()

Gets the minimum required register count implied by this instance. This is equal to the highest register number referred to plus the widest width (largest category) of the type used in that register.

Returns:int

>= 0; the required registers size

getTypeback to summary
public Type getType(int n)

Implements org.droidparts.dexmaker.dx.rop.type.TypeList.getType.

Doc from org.droidparts.dexmaker.dx.rop.type.TypeList.getType.

Gets the indicated element. It is an error to call this with the index for an element which was never set; if you do that, this will throw NullPointerException.

Parameters
n:int

>= 0, < size(); which element

Returns:Type

non-null; the indicated element

getWordCountback to summary
public int getWordCount()

Implements org.droidparts.dexmaker.dx.rop.type.TypeList.getWordCount.

Doc from org.droidparts.dexmaker.dx.rop.type.TypeList.getWordCount.

Gets the number of 32-bit words required to hold instances of all the elements of this list. This is a sum of the widths (categories) of all the elements.

Returns:int

>= 0; the required number of words

indexOfRegisterback to summary
public int indexOfRegister(int reg)

Returns the index of a RegisterSpec in this list that uses the specified register, or -1 if none in this list uses the register.

Parameters
reg:int

Register to find

Returns:int

index of RegisterSpec or -1

makeback to summary
public static RegisterSpecList make(RegisterSpec spec)

Makes a single-element instance.

Parameters
spec:RegisterSpec

non-null; the element

Returns:RegisterSpecList

non-null; an appropriately-constructed instance

makeback to summary
public static RegisterSpecList make(RegisterSpec spec0, RegisterSpec spec1)

Makes a two-element instance.

Parameters
spec0:RegisterSpec

non-null; the first element

spec1:RegisterSpec

non-null; the second element

Returns:RegisterSpecList

non-null; an appropriately-constructed instance

makeback to summary
public static RegisterSpecList make(RegisterSpec spec0, RegisterSpec spec1, RegisterSpec spec2)

Makes a three-element instance.

Parameters
spec0:RegisterSpec

non-null; the first element

spec1:RegisterSpec

non-null; the second element

spec2:RegisterSpec

non-null; the third element

Returns:RegisterSpecList

non-null; an appropriately-constructed instance

makeback to summary
public static RegisterSpecList make(RegisterSpec spec0, RegisterSpec spec1, RegisterSpec spec2, RegisterSpec spec3)

Makes a four-element instance.

Parameters
spec0:RegisterSpec

non-null; the first element

spec1:RegisterSpec

non-null; the second element

spec2:RegisterSpec

non-null; the third element

spec3:RegisterSpec

non-null; the fourth element

Returns:RegisterSpecList

non-null; an appropriately-constructed instance

setback to summary
public void set(int n, RegisterSpec spec)

Sets the element at the given index.

Parameters
n:int

>= 0, < size(); which element

spec:RegisterSpec

non-null; the value to store

specForRegisterback to summary
public RegisterSpec specForRegister(int reg)

Returns a RegisterSpec in this list that uses the specified register, or null if there is none in this list.

Parameters
reg:int

Register to find

Returns:RegisterSpec

RegisterSpec that uses argument or null.

subsetback to summary
public RegisterSpecList subset(BitSet exclusionSet)

Returns a new instance, which contains a subset of the elements specified by the given BitSet. Indexes in the BitSet with a zero are included, while indexes with a one are excluded. Mutability of the result is inherited from the original.

Parameters
exclusionSet:BitSet

non-null; set of registers to exclude

Returns:RegisterSpecList

non-null; an appropriately-constructed instance

withAddedTypeback to summary
public TypeList withAddedType(Type type)

Implements org.droidparts.dexmaker.dx.rop.type.TypeList.withAddedType.

Doc from org.droidparts.dexmaker.dx.rop.type.TypeList.withAddedType.

Returns a new instance which is identical to this one, except that the given item is appended to the end and it is guaranteed to be immutable.

Parameters
type:Type

non-null; item to append

Returns:TypeList

non-null; an appropriately-constructed instance

withExpandedRegistersback to summary
public RegisterSpecList withExpandedRegisters(int base, boolean duplicateFirst, BitSet compatRegs)

Returns an instance that is identical to this one, except that all incompatible register numbers are renumbered sequentially from the given base, with the first number duplicated if indicated. If a null BitSet is given, it indicates all registers are compatible.

Parameters
base:int

the base register number

duplicateFirst:boolean

whether to duplicate the first number

compatRegs:BitSet

null-ok; either a non-null set of compatible registers, or null to indicate all registers are compatible

Returns:RegisterSpecList

non-null; an appropriately-constructed instance

withFirstback to summary
public RegisterSpecList withFirst(RegisterSpec spec)

Returns a new instance, which is the same as this instance, except that it has an additional element prepended to the original. Mutability of the result is inherited from the original.

Parameters
spec:RegisterSpec

non-null; the new first spec (to prepend)

Returns:RegisterSpecList

non-null; an appropriately-constructed instance

withOffsetback to summary
public RegisterSpecList withOffset(int delta)

Returns an instance that is identical to this one, except that all register numbers are offset by the given amount. Mutability of the result is inherited from the original.

Parameters
delta:int

the amount to offset the register numbers by

Returns:RegisterSpecList

non-null; an appropriately-constructed instance

withoutFirstback to summary
public RegisterSpecList withoutFirst()

Returns a new instance, which is the same as this instance, except that its first element is removed. Mutability of the result is inherited from the original.

Returns:RegisterSpecList

non-null; an appropriately-constructed instance

withoutLastback to summary
public RegisterSpecList withoutLast()

Returns a new instance, which is the same as this instance, except that its last element is removed. Mutability of the result is inherited from the original.

Returns:RegisterSpecList

non-null; an appropriately-constructed instance