public class InMemoryEntity extends java.lang.Object implements Entity
Entity
interface.
The provided implementation is immutable and, therefore, instances can be freely shared.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
equalsIgnoreCase(Token anotherToken)
Compares this token to another token ignoring case considerations.
|
static InMemoryEntity |
getInstance(java.lang.String text,
java.lang.String lemma,
java.lang.String type,
java.lang.String... morphologicalTags)
Returns an
InMemoryEntity that corresponds to the specified arguments. |
java.lang.String |
getLemma()
Returns the lemma of this entity.
|
java.util.List<java.lang.String> |
getMorphologicalTags()
Returns the list of morphological tags of this entity.
|
java.lang.String |
getText()
Returns the text that forms this element.
|
java.lang.String |
getType()
Returns the type of this entity.
|
int |
hashCode() |
InMemoryEntity |
toLowerCase()
Returns the lower case representation of this entity.
|
java.lang.String |
toString() |
public static InMemoryEntity getInstance(java.lang.String text, java.lang.String lemma, java.lang.String type, java.lang.String... morphologicalTags)
InMemoryEntity
that corresponds to the specified arguments.text
- the text that the entity to create should consist of.lemma
- the lemma of the entity to create.type
- a string that identifies the type of the entity to create.morphologicalTags
- a set of tags that describe how the specified lemma is inflected to generate the text itself.InMemoryEntity
that corresponds to the specified arguments.public java.lang.String getText()
LeafElement
getText
in interface LeafElement
public java.lang.String getLemma()
Entity
public java.lang.String getType()
Entity
public java.util.List<java.lang.String> getMorphologicalTags()
Entity
getMorphologicalTags
in interface Entity
public InMemoryEntity toLowerCase()
Entity
toLowerCase
in interface Entity
toLowerCase
in interface Token
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean equalsIgnoreCase(Token anotherToken)
Token
equalsIgnoreCase
in interface Token
anotherToken
- The token to compare this token against.true
if the argument is not null
and the tokens are equal; false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object