|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.ling.ValueLabel
edu.stanford.nlp.ling.StringLabel
public class StringLabel
A StringLabel object acts as a Label by containing a
single String, which it sets or returns in response to requests.
The hashCode() and compareTo() methods for this class assume that this
string value is non-null. equals() is correctly implemented
| Constructor Summary | |
|---|---|
StringLabel()
Create a new StringLabel with a null content (i.e., str). |
|
StringLabel(Label label)
Create a new StringLabel with the
value() of another label as its label. |
|
StringLabel(java.lang.String str)
Create a new StringLabel with the given content. |
|
StringLabel(java.lang.String str,
int beginPosition,
int endPosition)
Create a new StringLabel with the given content. |
|
| Method Summary | |
|---|---|
int |
beginPosition()
Return the beginning character offset of the label (or -1 if none). |
int |
endPosition()
Return the ending character offset of the label (or -1 if none). |
static LabelFactory |
factory()
Return a factory for this kind of label. |
LabelFactory |
labelFactory()
Return a factory for this kind of label (i.e., StringLabel). |
void |
setBeginPosition(int beginPosition)
Set the beginning character offset for the label. |
void |
setEndPosition(int endPosition)
Set the ending character offset of the label (or -1 if none). |
void |
setFromString(java.lang.String str)
Set the label from a String. |
void |
setValue(java.lang.String value)
Set the value for the label. |
java.lang.String |
toString()
Return a string representation of the label. |
java.lang.String |
value()
Return the word value of the label (or null if none). |
| Methods inherited from class edu.stanford.nlp.ling.ValueLabel |
|---|
compareTo, equals, hashCode |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StringLabel()
StringLabel with a null content (i.e., str).
public StringLabel(java.lang.String str)
StringLabel with the given content.
str - The new label's content
public StringLabel(java.lang.String str,
int beginPosition,
int endPosition)
StringLabel with the given content.
str - The new label's contentbeginPosition - Start offset in original textendPosition - End offset in original textpublic StringLabel(Label label)
StringLabel with the
value() of another label as its label.
label - The other label| Method Detail |
|---|
public java.lang.String value()
value in interface Labelvalue in class ValueLabelpublic void setValue(java.lang.String value)
setValue in interface LabelsetValue in class ValueLabelvalue - The value for the labelpublic void setFromString(java.lang.String str)
setFromString in interface LabelsetFromString in class ValueLabelstr - The str for the labelpublic java.lang.String toString()
ValueLabelvalue() if it is non-null,
and the empty string otherwise.
toString in interface LabeltoString in class ValueLabelpublic LabelFactory labelFactory()
StringLabel).
The factory returned is always the same one (a singleton).
labelFactory in interface LabellabelFactory in class ValueLabelpublic static LabelFactory factory()
public int beginPosition()
HasOffset
beginPosition in interface HasOffsetpublic int endPosition()
HasOffset
endPosition in interface HasOffsetpublic void setBeginPosition(int beginPosition)
HasOffset
setBeginPosition in interface HasOffsetbeginPosition - The beginning positionpublic void setEndPosition(int endPosition)
HasOffset
setEndPosition in interface HasOffsetendPosition - The end character offset for the label
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||