public class PositionedString extends Object
Modifier and Type | Field and Description |
---|---|
private static ImmutableArray<TermLabel> |
EMPTY_LABEL_LIST |
String |
fileName |
Position |
pos |
String |
text |
Constructor and Description |
---|
PositionedString(String text) |
PositionedString(String text,
String fileName) |
PositionedString(String text,
String fileName,
Position pos) |
PositionedString(String text,
Token t) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsLabel(TermLabel label)
checks if the given label is attached to the positioned string
|
boolean |
equals(Object o) |
ImmutableArray<TermLabel> |
getLabels()
returns list of labels attached to this positioned string
|
int |
hashCode() |
boolean |
hasLabels()
returns true if the positioned string is labeled
|
PositionedLabeledString |
label(ImmutableArray<TermLabel> labels) |
PositionedLabeledString |
label(TermLabel label) |
PositionedString |
prepend(String text) |
PositionedString |
prependAndUpdatePosition(String text) |
String |
toString() |
public final String text
public final String fileName
public final Position pos
private static final ImmutableArray<TermLabel> EMPTY_LABEL_LIST
public PositionedString(String text)
public PositionedString prependAndUpdatePosition(String text)
public PositionedString prepend(String text)
public boolean hasLabels()
public boolean containsLabel(TermLabel label)
label
- the ITermLabel for which to look (must not be null)public ImmutableArray<TermLabel> getLabels()
null
public PositionedLabeledString label(ImmutableArray<TermLabel> labels)
public PositionedLabeledString label(TermLabel label)