edu.mit.sketch.system
Class Holder

java.lang.Object
  |
  +--edu.mit.sketch.system.Holder
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
ObjectHolder, PropertyHolder

public abstract class Holder
extends Object
implements Cloneable

This class is used in the template class. It holds a type of BBItem and possibly a pointer to an instance of that item. It is used as a type of "promise", saying that eventually we must fill in the holder with the item of the specified type.

Created: Thu Jan 17 15:42:00 2002
Copyright: Copyright (C) 2002 by MIT. All rights reserved.


Method Summary
 void bind(BBItem item)
          Set the BBItem that this holder points to.
 boolean canHold(BBItem item)
          This checks if it is valid to bind the given BBItem to this holder.
protected  Object clone()
           
 BBItem getBBItem()
           
 BBItemType getType()
           
 boolean isBound()
          This holder is unbound if the item has not been set yet.
 void unbind()
          Stop refering to the BBItem that was previously referred to.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getType

public BBItemType getType()

getBBItem

public BBItem getBBItem()

bind

public void bind(BBItem item)
Set the BBItem that this holder points to. It will either be a template, primitive object, or property.

unbind

public void unbind()
Stop refering to the BBItem that was previously referred to.

isBound

public boolean isBound()
This holder is unbound if the item has not been set yet.

canHold

public boolean canHold(BBItem item)
This checks if it is valid to bind the given BBItem to this holder. If it is a valid binding then return true. If the argument is the same as our current binding return true.

clone

protected Object clone()
Overrides:
clone in class Object