|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.classify.feature.Feature
public abstract class Feature
An abstract base class for immutable feature representation used for classification.
Constructor Summary | |
---|---|
Feature()
Creates a new instance, without storing a comment. |
|
Feature(String myComment)
Creates a new instance. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one, fulfulling the Object.equals(java.lang.Object) contract. |
String |
getComment()
Returns the comment attached to this feature, if any. |
String |
getFullRepresentation()
Prints a full representation of this feature that contains both representation (if any) and comment (if any). |
String |
getFullRepresentation(String separator)
Prints a full representation of this feature that contains both representation (if any) and comment (if any). |
abstract String |
getRepresentation()
Abstract method for returning the representation of this feature, to be used for classification. |
float |
getStrength()
Returns a strength value for this feature. |
int |
hashCode()
Returns a hash code value for this object, fulfulling the Object.hashCode() contract. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Feature()
public Feature(String myComment)
myComment
- a comment on this feature, ignored for classification;
might be null
Method Detail |
---|
public boolean equals(Object obj)
Object.equals(java.lang.Object)
contract. To be considered
equal, the object must be a Feature
. If the
representation of this instance is not
null
, the representations of the two features are compared.
Otherwise the full representations
are compared. Thus for normal features comments and other fields will
be ignored. For comment-only features, comments will be considered,
other fields will be ignored.
equals
in class Object
obj
- the reference object with which to compare
true
iff the specified object is a
Feature
equal to this instancepublic String getComment()
null
is no comment was storedpublic String getFullRepresentation()
public String getFullRepresentation(String separator)
separator
(surrounded by spaces).
separator
- used to introduce the comment
public abstract String getRepresentation()
null
if this feature
contains only a commentpublic float getStrength()
Typically you should call FeatureVector.strength(Feature)
instead of this method to allow feature vectors to modify the strenghts
of the stored features.
public int hashCode()
Object.hashCode()
contract.
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |