public final class Label
extends java.lang.Object
Label
class describes a label set in test templates and
symbolic test programs.Modifier and Type | Field and Description |
---|---|
static int |
NO_REFERENCE_NUMBER |
static int |
NO_SEQUENCE_INDEX |
Constructor and Description |
---|
Label(Label other)
Constructs a copy of the specified label.
|
Label(java.lang.String name,
BlockId blockId)
Constructs a label object.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<Label> |
copyAll(java.util.List<Label> labels)
Creates a deep copy of the specified label list.
|
boolean |
equals(java.lang.Object obj) |
BlockId |
getBlockId()
Returns the identifier of the block where the label was defined.
|
java.lang.String |
getName()
Returns the name of the label as it was defined in a test template.
|
int |
getReferenceNumber()
Returns a number that uniquely identifies the label among labels that have the same name.
|
int |
getSequenceIndex()
Returns an index that identifies the instruction sequence where the label is defined.
|
java.lang.String |
getUniqueName()
Returns a unique name for the label based on:
Label name
Block identifier if it is not a root (no parent) block
Reference number if it set
Sequence index if it set
|
int |
hashCode() |
void |
setReferenceNumber(int value)
Assigns a number that uniquely identifies the label which is duplicated within an
instruction sequence.
|
void |
setSequenceIndex(int value)
Assigns an index that identifies the instruction sequence where the label is defined.
|
java.lang.String |
toString()
Returns textual representation of the label based on its unique name.
|
public static final int NO_REFERENCE_NUMBER
public static final int NO_SEQUENCE_INDEX
public Label(java.lang.String name, BlockId blockId)
name
- The name of the label.blockId
- The identifier of the block where the label is defined.java.lang.IllegalStateException
- if any of the parameters equals null
.public Label(Label other)
other
- Label to be copied.public static java.util.List<Label> copyAll(java.util.List<Label> labels)
labels
- List of labels to be copied.java.lang.IllegalArgumentException
- if the parameter is null
.public void setReferenceNumber(int value)
value
- Number that uniquely identifies a label which is duplicated within a sequence.public int getReferenceNumber()
public void setSequenceIndex(int value)
value
- Index that identifies the instruction sequence where the label is defined.public int getSequenceIndex()
public java.lang.String getName()
public java.lang.String getUniqueName()
public BlockId getBlockId()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object