org.apache.taglibs.rdc.sampleapps.musicstore
Class ProactiveHelp

java.lang.Object
  extended by org.apache.taglibs.rdc.sampleapps.musicstore.ProactiveHelp

public class ProactiveHelp
extends java.lang.Object

Implements a simple proactive help (user hints) java bean

Author:
Jaroslav Gergic

Field Summary
protected  java.util.ResourceBundle hints
           
protected  int threshold
          The probability the proactive help component will trigger <0..100> inclusive.
protected  boolean usageWeighted
          Adjust probabilities based on play count for each particular hint.
 
Constructor Summary
ProactiveHelp()
           
 
Method Summary
 java.util.ResourceBundle getHints()
          Access method for the hints property.
 java.util.Map getStats()
           
 int getThreshold()
          Access method for the threshold property.
 boolean getUsageWeighted()
          Determines if the usageWeighted property is true.
 java.lang.String nextHint()
           
 void setHints(java.util.ResourceBundle aHints)
          Sets the value of the hints property.
 void setStats(java.util.Map sts)
           
 void setThreshold(int aThreshold)
          Sets the value of the threshold property.
 void setUsageWeighted(boolean aUsageWeighted)
          Sets the value of the usageWeighted property.
 boolean strike()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threshold

protected int threshold
The probability the proactive help component will trigger <0..100> inclusive. The default value is 30%


usageWeighted

protected boolean usageWeighted
Adjust probabilities based on play count for each particular hint.


hints

protected java.util.ResourceBundle hints
Constructor Detail

ProactiveHelp

public ProactiveHelp()
Method Detail

getThreshold

public int getThreshold()
Access method for the threshold property.

Returns:
the current value of the threshold property

setThreshold

public void setThreshold(int aThreshold)
Sets the value of the threshold property.

Parameters:
aThreshold - the new value of the threshold property

getUsageWeighted

public boolean getUsageWeighted()
Determines if the usageWeighted property is true.

Returns:
true if the usageWeighted property is true

setUsageWeighted

public void setUsageWeighted(boolean aUsageWeighted)
Sets the value of the usageWeighted property.

Parameters:
aUsageWeighted - the new value of the usageWeighted property

strike

public boolean strike()
Returns:
boolean

nextHint

public java.lang.String nextHint()
Returns:
java.lang.String

getStats

public java.util.Map getStats()
Returns:
java.util.Map

getHints

public java.util.ResourceBundle getHints()
Access method for the hints property.

Returns:
the current value of the hints property

setHints

public void setHints(java.util.ResourceBundle aHints)
Sets the value of the hints property.

Parameters:
aHints - the new value of the hints property

setStats

public void setStats(java.util.Map sts)
Parameters:
sts - a map of (hintKey, playCount) where playCount can be either Integer or String


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.