edu.washington.cs.supple.rep
Class SameRenderingHint

java.lang.Object
  extended byedu.washington.cs.supple.rep.AbstractRenderingHint
      extended byedu.washington.cs.supple.rep.SameRenderingHint
All Implemented Interfaces:
RenderingHint, java.io.Serializable

public class SameRenderingHint
extends AbstractRenderingHint

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

Field Summary
 
Fields inherited from class edu.washington.cs.supple.rep.AbstractRenderingHint
lastUid, objects, strength, uid
 
Fields inherited from interface edu.washington.cs.supple.rep.RenderingHint
serialVersionUID
 
Constructor Summary
SameRenderingHint(int strength)
           
SameRenderingHint(int strength, java.util.Collection objects)
           
 
Method Summary
 float getWidgetFit(java.util.Vector widgetBags, Widget widget)
          Checks if all bags have a widget of the same type as widget
protected  boolean hasWidgetType(WidgetBag bag, java.lang.Class type)
          Checks if the bag is still considering any elements of the specified type
 java.lang.String toString()
           
 
Methods inherited from class edu.washington.cs.supple.rep.AbstractRenderingHint
addUiObject, addUiObjects, equals, getStrength, getUiObjects, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SameRenderingHint

public SameRenderingHint(int strength)

SameRenderingHint

public SameRenderingHint(int strength,
                         java.util.Collection objects)
Method Detail

getWidgetFit

public float getWidgetFit(java.util.Vector widgetBags,
                          Widget widget)
Checks if all bags have a widget of the same type as widget

Parameters:
widgetBags - all widget bags which a part of this hint
widget -
Returns:
1 if all bags have the widget, 0 if at least one of the bags does not have a widget of the same type

hasWidgetType

protected boolean hasWidgetType(WidgetBag bag,
                                java.lang.Class type)
Checks if the bag is still considering any elements of the specified type

Parameters:
bag - the bag under consideration
type - the widget type
Returns:
true if an element of a given type was found, false otherwise

toString

public java.lang.String toString()