public final class Label extends Object implements Comparable<Label>, Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
Label.LabelKind |
Modifier and Type | Field and Description |
---|---|
static int |
NO_POSITION
The inital offset of a label.
|
Constructor and Description |
---|
Label() |
Label(String label_text) |
Label(String label_text,
Label.LabelKind mustTargetExectuable) |
Modifier and Type | Method and Description |
---|---|
void |
adjustOffset(int base_offset)
This Label has been inherited by a new InstructionList, so its offset
must be adjusted to point to its new position within the inheriting
InstructionList.
|
Object |
clone()
Clone this label.
|
int |
compareTo(Label o)
The natural sort order for a Label is its instruction's offset.
|
int |
getPosition() |
void |
setPosition(int pos)
Set this Label's offset in its initial InstructionList.
|
boolean |
targetMustBeExecutable()
Does this label have to fall on an executable instruction, or can it fall
on any old instruction (such as a OP_debugline).
|
String |
toString() |
public static final int NO_POSITION
public Label(String label_text)
public Label(String label_text, Label.LabelKind mustTargetExectuable)
public Label()
public int compareTo(Label o)
compareTo
in interface Comparable<Label>
public void setPosition(int pos)
pos
- - the Label's offset in the InstructionList., which the InstructionList keeps this position updated.
public int getPosition()
public void adjustOffset(int base_offset)
base_offset
- - the amount to adjust the position. Think of the
position as a displacement, and the inherting list's size as a base.public Object clone()
public boolean targetMustBeExecutable()
Copyright © 2016 The Apache Software Foundation. All rights reserved.