edu.washington.cs.supple.render
Interface CostFunction

All Known Implementing Classes:
AbstractCostFunction

public interface CostFunction

Author:
kgajos To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Method Summary
 float getAssignmentCost(Widget widget)
           
 float getHintCost(RenderingHint hint, float fit)
          Used by RenderingHintEnforcer to convert widget's fit returned by a rendering hint to actual cost
 float getShortcutCost(Shortcut shortcut)
          The signature for this method will probably change at some point; it computes the cost associated with a particular shortcut.
 TransitionCount getTransitionCountFunction()
          A transition count provides information on the usage of the container elements of a UI
 void setTransitionCountFunction(TransitionCount tc)
          A transition count provides information on the usage of the container elements of a UI
 

Method Detail

getAssignmentCost

public float getAssignmentCost(Widget widget)
Parameters:
widget - widget whose cost is to be analysed
Returns:
the cost of assigning this widget to its corresponding ui element; -1 if widget is not acceptable

getHintCost

public float getHintCost(RenderingHint hint,
                         float fit)
Used by RenderingHintEnforcer to convert widget's fit returned by a rendering hint to actual cost

Parameters:
fit - the fit (between 0.0 and 1.0
Returns:
the cost incurred by the widget based on its compliance with the hint

getShortcutCost

public float getShortcutCost(Shortcut shortcut)
The signature for this method will probably change at some point; it computes the cost associated with a particular shortcut. At the moment it assumes a fixed cost per access regardless of how the shortcut is rendered. This is clearly wrong but we will worry about it later

Parameters:
shortcut - shortcut to be evaluated
Returns:
the associated cost (which depends on how much traffic goes through the shortcut)

setTransitionCountFunction

public void setTransitionCountFunction(TransitionCount tc)
A transition count provides information on the usage of the container elements of a UI

Parameters:
tc - a transition count function

getTransitionCountFunction

public TransitionCount getTransitionCountFunction()
A transition count provides information on the usage of the container elements of a UI

Returns:
tc a transition count function