de.uni_leipzig.bf.util
Class WeightedKeyword

java.lang.Object
  extended by de.uni_leipzig.bf.util.WeightedKeyword
All Implemented Interfaces:
java.lang.Comparable

public class WeightedKeyword
extends java.lang.Object
implements java.lang.Comparable

This class is a help class with objects composed of keyword and its weight for later retrieval. This weight should be between 0 and 1 inclusive.

Author:
an
 

Constructor Summary
WeightedKeyword(java.lang.String _word, double _weight)
          Creates a new instance of WeightedKeyword
 
Method Summary
 int compareTo(java.lang.Object o)
           
 java.lang.String getKeyword()
          Get the actual value of keyword
 double getWeight()
          Get the actual value of the weight
 boolean setWeight(double _weight)
          Sets the weight of the keyword.
 java.lang.String toString()
          Writes the keyword and the associated weight in a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WeightedKeyword

public WeightedKeyword(java.lang.String _word,
                       double _weight)
Creates a new instance of WeightedKeyword

Parameters:
_word - Keyword
_weight - Associated weight
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

getKeyword

public java.lang.String getKeyword()
Get the actual value of keyword

Returns:
The actual value of keyword

getWeight

public double getWeight()
Get the actual value of the weight

Returns:
The actual value of weight

setWeight

public boolean setWeight(double _weight)
Sets the weight of the keyword. Returns true when the parameter _weight is in the interval [0,1], else false.

Parameters:
_weight - New weight
Returns:
see description

toString

public java.lang.String toString()
Writes the keyword and the associated weight in a String

Overrides:
toString in class java.lang.Object
Returns:
see description