com.autonomy.aci.businessobjects
Class TermsNWeights

java.lang.Object
  extended bycom.autonomy.aci.businessobjects.AciBusinessObject
      extended bycom.autonomy.aci.businessobjects.TermsNWeights
All Implemented Interfaces:
java.io.Serializable

public class TermsNWeights
extends AciBusinessObject

Holds details of the terms and weights assosciated with a document, category, agent or profile.

See Also:
Serialized Form

Field Summary
static java.lang.String TERM_AND_WEIGHT_SEPARATOR
           
static java.lang.String TERMS_AND_WEIGHTS_SEPARATOR
           
 
Constructor Summary
TermsNWeights()
          Construct a TermsNWeights object with no term information set.
 
Method Summary
 void clearTermsNWeights()
          Remove all terms from the list of terms.
 java.lang.Object clone()
          Makes a deep copy of this object.
 java.util.Set getTerms()
          Get the names of all the terms set.
 java.util.HashMap getTermsNWeights()
          Get a mapping of all the terms and weights that this object encapsulates.
 int getTermWeighting(java.lang.String sTerm)
          Reads the weighting assosciated with a given term.
 void removeTermNWeight(java.lang.String sTerm)
          Remove a term from the list of terms.
 void setTermNWeight(java.lang.String sTerm, int nWeight)
          Set the value for a term.
 void setTermsNWeights(java.util.Map termsNWeightsMap)
          Set all the terms and weights that this object encapsulates.
 java.lang.String toString()
          Writes the terms and weights information as a string in IDOL format ([Term1]Weight1~[Term2]Weight2~.....).
 
Methods inherited from class com.autonomy.aci.businessobjects.AciBusinessObject
getUID, setUID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TERMS_AND_WEIGHTS_SEPARATOR

public static final java.lang.String TERMS_AND_WEIGHTS_SEPARATOR
See Also:
Constant Field Values

TERM_AND_WEIGHT_SEPARATOR

public static final java.lang.String TERM_AND_WEIGHT_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

TermsNWeights

public TermsNWeights()
Construct a TermsNWeights object with no term information set.

Method Detail

setTermsNWeights

public void setTermsNWeights(java.util.Map termsNWeightsMap)
Set all the terms and weights that this object encapsulates.

Parameters:
termsNWeightsMap - a mapping between all the terms and their weights. Both the keys (term names) and values (term weights) of the Map should be Strings.

setTermNWeight

public void setTermNWeight(java.lang.String sTerm,
                           int nWeight)
Set the value for a term. If the term is already set, it's weight will be overwritten with the new value.

Parameters:
sTerm - the name of the term.
nWeight - the weighting of the term.

removeTermNWeight

public void removeTermNWeight(java.lang.String sTerm)
Remove a term from the list of terms.

Parameters:
sTerm - the name of the term.

clearTermsNWeights

public void clearTermsNWeights()
Remove all terms from the list of terms.


getTerms

public java.util.Set getTerms()
Get the names of all the terms set.

Returns:
a Set of Strings giving the names of all the terms set.

getTermsNWeights

public java.util.HashMap getTermsNWeights()
Get a mapping of all the terms and weights that this object encapsulates.

Returns:
a mapping between all the terms and their weights. Both the keys (term names) and values (term weights) of the Map are Strings.

getTermWeighting

public int getTermWeighting(java.lang.String sTerm)
Reads the weighting assosciated with a given term.

Parameters:
sTerm - the term.

clone

public java.lang.Object clone()
Makes a deep copy of this object.


toString

public java.lang.String toString()
Writes the terms and weights information as a string in IDOL format ([Term1]Weight1~[Term2]Weight2~.....).