public final class DataSection extends Object implements Iterable<DataSection.Data>
| Modifier and Type | Class and Description |
|---|---|
static class |
DataSection.Data |
static class |
DataSection.PackedData |
static interface |
DataSection.Patches |
static class |
DataSection.RawData |
static class |
DataSection.SerializableData |
static class |
DataSection.ZeroData |
| Constructor and Description |
|---|
DataSection() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(DataSection other)
Transfers all
DataSection.Data from the provided other DataSection to this
DataSection, and empties the other section. |
void |
buildDataSection(ByteBuffer buffer,
DataSection.Patches patch)
Builds the data section into a given buffer.
|
void |
buildDataSection(ByteBuffer buffer,
DataSection.Patches patch,
BiConsumer<DataSectionReference,Integer> onEmit)
Builds the data section into a given buffer.
|
void |
clear() |
void |
close(OptionValues option)
Computes the layout of the data section and closes this object to further updates.
|
boolean |
closed()
Determines if this object has been
closed. |
static void |
emit(ByteBuffer buffer,
DataSection.Data data,
DataSection.Patches patch) |
boolean |
equals(Object obj) |
DataSection.Data |
findData(DataSectionReference ref) |
int |
getSectionAlignment()
Gets the minimum alignment requirement of the data section.
|
int |
getSectionSize()
Gets the size of the data section.
|
int |
hashCode() |
DataSectionReference |
insertData(DataSection.Data data)
Inserts a
DataSection.Data item into the data section. |
Iterator<DataSection.Data> |
iterator() |
static int |
lcm(int x,
int y) |
String |
toString() |
forEach, spliteratorpublic DataSectionReference insertData(DataSection.Data data)
DataSection.Data item into the data section. If the item is already in the data
section, the same DataSectionReference is returned.data - the DataSection.Data item to be insertedDataSectionReference identifying the DataSection.Data itempublic void addAll(DataSection other)
DataSection.Data from the provided other DataSection to this
DataSection, and empties the other section.public boolean closed()
closed.public void close(OptionValues option)
public int getSectionSize()
public int getSectionAlignment()
public void buildDataSection(ByteBuffer buffer, DataSection.Patches patch)
buffer - the ByteBuffer where the data section should be built. The buffer must
hold at least DataSection.getSectionSize() bytes.patch - a DataSection.Patches instance to receive constants for
relocations in the data sectionpublic void buildDataSection(ByteBuffer buffer, DataSection.Patches patch, BiConsumer<DataSectionReference,Integer> onEmit)
buffer - the ByteBuffer where the data section should be built. The buffer must
hold at least DataSection.getSectionSize() bytes.patch - a DataSection.Patches instance to receive constants foronEmit - a function that is called before emitting each data item with the
DataSectionReference and the size of the data.public DataSection.Data findData(DataSectionReference ref)
public static void emit(ByteBuffer buffer, DataSection.Data data, DataSection.Patches patch)
public Iterator<DataSection.Data> iterator()
iterator in interface Iterable<DataSection.Data>public static int lcm(int x,
int y)
public void clear()