public class InMemoryPhrase extends java.lang.Object implements Phrase
Phrase
interface.
The provided implementation is immutable and, therefore, instances can be freely shared. Moreover, the class keeps track of all the instances created so far that are still alive, reusing them when it is possible or, in other words, avoiding the creation of new instances unless it is strictly necessary.
Modifier and Type | Class and Description |
---|---|
static class |
InMemoryPhrase.Builder
A builder to create
InMemoryPhrase instances. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.List<PhraseElement> |
getChildren()
Returns the children of this phrase, which can be either other
Phrase s or LeafElement s (Token s and the
Space s separating them). |
java.lang.String |
getLabel()
Returns the label that describes the syntactical function of this phrase.
|
int |
hashCode() |
java.lang.String |
toString() |
public java.lang.String getLabel()
Phrase
public java.util.List<PhraseElement> getChildren()
Phrase
Phrase
s or LeafElement
s (Token
s and the
Space
s separating them).getChildren
in interface Phrase
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object