|
||||||||||
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 | |
---|---|
Long |
compactRepresentation()
Returns a compact representation for this object. |
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. |
Object[] |
getUserData()
Returns an array of objects that can be used by a user to store additional information about this feature; not used by default. |
int |
hashCode()
Deprecated. use compactRepresentation() instead |
void |
setUserData(Object[] newUserData)
Replaces the array of objects that can be used by a user to stor additional information about this feature. |
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 Long compactRepresentation()
Util.longHash(String)
.
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 Object[] getUserData()
null
public 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 int hashCode()
compactRepresentation()
instead
Object.hashCode()
contract.
hashCode
in class Object
public void setUserData(Object[] newUserData)
newUserData
- the new value of the attributepublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |