|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.whatswrong.TokenProperty
public class TokenProperty
A TokenProperty represents a property of a token, such as the 'Word' or "PoS-Tag' property. A Token
then maps
such properties to property values, such as "house" or "NN". Each TokenProperty has a name (say 'Word') and an
integer 'level' that can be used to define an order on properties. This order is for example used when the properties
of a token are stacked under each other in the graphical representation of a token.
Constructor Summary | |
---|---|
TokenProperty(int level)
Creates a property with the given level and the name 'Property [level]' where [level] will be replaced with the given level. |
|
TokenProperty(java.lang.String name)
Creates a property with the given name and level 0. |
|
TokenProperty(java.lang.String name,
int level)
Create new property with given name and level. |
Method Summary | |
---|---|
int |
compareTo(TokenProperty o)
First compares the level of the two properties and if these are equal the property names are compared. |
boolean |
equals(java.lang.Object o)
Two TokenProperty objects are equal iff their names match. |
int |
getLevel()
Returns the level of the property. |
java.lang.String |
getName()
Returns the name of the property. |
int |
hashCode()
Calculates a hashcode based on the property name. |
java.lang.String |
toString()
Returns the name of the property. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TokenProperty(java.lang.String name, int level)
name
- the name of the property.level
- the level of the property.public TokenProperty(java.lang.String name)
name
- the name of the property.public TokenProperty(int level)
level
- the level of the property.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
public int getLevel()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the other property.
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(TokenProperty o)
compareTo
in interface java.lang.Comparable<TokenProperty>
o
- the other property.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |