public class MmuStruct
extends java.lang.Object
MmuStruct
class describes a variable represented
by a structure (a list of IntegerVariable
objects).Modifier and Type | Field and Description |
---|---|
protected int |
bitSize |
protected MmuBuffer |
buffer |
protected java.util.List<IntegerVariable> |
fields |
protected java.lang.String |
name |
Constructor and Description |
---|
MmuStruct(java.lang.String name,
IntegerVariable... variables)
Constructs an MmuStruct object.
|
Modifier and Type | Method and Description |
---|---|
void |
addField(IntegerVariable field)
Registers an new field.
|
void |
addField(MmuStruct struct)
Registers fields defined in the specified structure.
|
java.util.List<MmuBinding> |
bindings(MmuStruct other)
Creates bindings between fields of two structures.
|
int |
getBitSize()
Returns the total size of all fields in the structure.
|
MmuBuffer |
getBuffer()
Returns the buffer associated with the structure (for buffer entries)
or
null if not applicable. |
int |
getFieldCount()
Returns the number of fields in the structure.
|
java.util.List<IntegerVariable> |
getFields()
Returns structure fields.
|
MmuStruct |
getInstance(java.lang.String instanceId,
MemoryAccessContext context) |
java.lang.String |
getName()
Returns the structure name.
|
void |
setBuffer(MmuBuffer buffer)
Sets the buffer associated with the structure (for buffer entries).
|
java.lang.String |
toString() |
protected final java.lang.String name
protected MmuBuffer buffer
protected final java.util.List<IntegerVariable> fields
protected int bitSize
public MmuStruct(java.lang.String name, IntegerVariable... variables)
name
- structure name.variables
- field variables.java.lang.IllegalArgumentException
- if name
equals null
or
if any of the field variables equals null
.public final java.lang.String getName()
public void setBuffer(MmuBuffer buffer)
buffer
- the buffer to be associated with the structure.java.lang.IllegalArgumentException
- if buffer
equals null
.public MmuBuffer getBuffer()
null
if not applicable.null
if not applicable.public final java.util.List<IntegerVariable> getFields()
public final void addField(IntegerVariable field)
field
- a field to be registered.java.lang.IllegalArgumentException
- if field == null
.public final void addField(MmuStruct struct)
struct
- Structure which contains fields to be registered.java.lang.IllegalArgumentException
- if struct
or any field it contains is null
.public final int getFieldCount()
public final int getBitSize()
public java.util.List<MmuBinding> bindings(MmuStruct other)
other
- Structure to be bound with the current one.java.lang.IllegalArgumentException
- if other
equals null
;
if the structures differ in size or field count;
if any of two fields to be bound differ in size.public MmuStruct getInstance(java.lang.String instanceId, MemoryAccessContext context)
public java.lang.String toString()
toString
in class java.lang.Object