edu.washington.cs.supple.rep
Class ActionTypeImpl

java.lang.Object
  extended byedu.washington.cs.supple.rep.SuppleBeanImpl
      extended byedu.washington.cs.supple.rep.BaseType
          extended byedu.washington.cs.supple.rep.ContainerTypeImpl
              extended byedu.washington.cs.supple.rep.ActionTypeImpl
All Implemented Interfaces:
ActionType, java.lang.Cloneable, ContainerType, java.io.Serializable, SuppleBean, SuppleType, ValueListener

public final class ActionTypeImpl
extends ContainerTypeImpl
implements ActionType, java.lang.Cloneable

Container type for actions.

Author:
kgajos
See Also:
Serialized Form

Field Summary
protected  java.util.Collection dependencies
           
protected  java.util.HashSet dynamicObjects
           
protected  UiObject parametersObject
           
protected  SuppleType parametersType
           
protected  SuppleType returnType
           
 
Fields inherited from class edu.washington.cs.supple.rep.ContainerTypeImpl
children, childTable, derivedFrom, dynamicChildren, hiddenChildren, numChildrenAdded, object
 
Fields inherited from class edu.washington.cs.supple.rep.BaseType
finalLegalValues, hasOrdering, lastUid, legalValues, legalValuesBinding, likelyValues, likelyValuesBinding, maxNumLegalValues, nullLegal, typicalIndexLength, uid
 
Fields inherited from class edu.washington.cs.supple.rep.SuppleBeanImpl
pcs
 
Constructor Summary
ActionTypeImpl(SuppleType returnType, UiObject parametersObject)
          Create an action type with the parameters type and the return type
 
Method Summary
 void addDependency(Reference r)
          The execution of an action might require values from other UiObjects, for instance state variables.
 void addDynamicObject(UiObject o)
          Stores a new dynamic object that was created by this action.
 java.lang.Object clone()
          Clone this type, does not clone children.
 java.util.Collection getDependencies()
          Returns a list of all dependencies.
 java.util.Collection getDynamicObjects()
          Returns a Collection of dynamic objects that were created by this action.
 UiObject getParameterObject(java.lang.String name)
          Locate the parameter ui object associated with the name.
 UiObject getParametersObject()
           
 SuppleType getParametersType()
           
 java.lang.Object getParameterValue(java.lang.String name)
          Locate the paramter value associated with the name.
 SuppleType getReturnType()
           
static ActionTypeImpl getVoidType()
           
 boolean hasIndex()
          Index is a short unique summary of the value (which can be used for choosing present values, etc.
protected  void init()
          Initialize the container type.
 boolean isEnumerable()
          This method tells you if possible values for this type can be (reasonably) enumerated
 boolean isLegalValueClass(java.lang.Class c)
          Check if a class is legal for this type.
 boolean isPrimitiveType()
          Test if this is a primitive type.
 void removeDynamicObject(UiObject o)
          Removes a dynamic object that was created by this action.
 java.lang.String toString()
           
 
Methods inherited from class edu.washington.cs.supple.rep.ContainerTypeImpl
accept, addChild, addDynamicChild, childrenHaveLabels, getChild, getChildren, getIndex, getNumChildren, getNumChildrenAdded, getUiObject, hasModifiableChild, rebindChildrenToValue, removeChild, size, swapChild, toPrettyString
 
Methods inherited from class edu.washington.cs.supple.rep.BaseType
addLegalValue, addLegalValueHelper, addLegalValues, addLikelyValue, addLikelyValueHelper, bindLegalValues, bindLikelyValues, ensureLegalValues, equals, getIndex, getLegalValues, getLikelyValues, getLongestLegalIndex, getMaxNumLegalValues, getNumLegalValues, getNumLikelyValues, getTypicalIndexLength, getUniqueId, hashCode, hasOrdering, hasSetLegalValues, isFinalLegalValues, isLegalValue, orderValues, setFinalLegalValues, setLegalValues, setLikelyValues, setMaxNumLegalValues, setTypicalIndexLength, valueChanged, verifyCurrentValue, visitBoundProperties
 
Methods inherited from class edu.washington.cs.supple.rep.SuppleBeanImpl
addPropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.washington.cs.supple.rep.ContainerType
childrenHaveLabels, getChild, getChildren, getNumChildren, getNumChildrenAdded, getUiObject, hasModifiableChild, removeChild, size, swapChild
 
Methods inherited from interface edu.washington.cs.supple.rep.SuppleType
accept, getIndex, getIndex, getLegalValues, getLikelyValues, getLongestLegalIndex, getMaxNumLegalValues, getNumLegalValues, getNumLikelyValues, getTypicalIndexLength, getUniqueId, hasOrdering, hasSetLegalValues, isFinalLegalValues, isLegalValue, orderValues, toPrettyString, verifyCurrentValue
 
Methods inherited from interface edu.washington.cs.supple.rep.SuppleBean
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

parametersType

protected SuppleType parametersType

returnType

protected SuppleType returnType

parametersObject

protected UiObject parametersObject

dependencies

protected java.util.Collection dependencies

dynamicObjects

protected java.util.HashSet dynamicObjects
Constructor Detail

ActionTypeImpl

public ActionTypeImpl(SuppleType returnType,
                      UiObject parametersObject)
Create an action type with the parameters type and the return type

Parameters:
returnType - the return type
Method Detail

clone

public java.lang.Object clone()
Description copied from class: ContainerTypeImpl
Clone this type, does not clone children.

Overrides:
clone in class ContainerTypeImpl

getVoidType

public static ActionTypeImpl getVoidType()
Returns:
Returns an ActionType with no parameters and no return value.

getParametersObject

public UiObject getParametersObject()
Specified by:
getParametersObject in interface ActionType
Returns:
Returns the UI for the action's parameters.

getParametersType

public SuppleType getParametersType()
Specified by:
getParametersType in interface ActionType
Returns:
Returns the UI type for the action's parameters.

getParameterObject

public UiObject getParameterObject(java.lang.String name)
Description copied from interface: ActionType
Locate the parameter ui object associated with the name. Assumes the parameters is a container.

Specified by:
getParameterObject in interface ActionType

getParameterValue

public java.lang.Object getParameterValue(java.lang.String name)
Description copied from interface: ActionType
Locate the paramter value associated with the name. Assumes the parameters is a container. Assumes the ui object is a variable of some sort.

Specified by:
getParameterValue in interface ActionType

getReturnType

public SuppleType getReturnType()
Specified by:
getReturnType in interface ActionType
Returns:
Returns the UI type for the action's return value (or null).

toString

public java.lang.String toString()
Overrides:
toString in class ContainerTypeImpl

isEnumerable

public boolean isEnumerable()
Description copied from interface: SuppleType
This method tells you if possible values for this type can be (reasonably) enumerated

Specified by:
isEnumerable in interface SuppleType
Overrides:
isEnumerable in class ContainerTypeImpl

hasIndex

public boolean hasIndex()
Description copied from interface: SuppleType
Index is a short unique summary of the value (which can be used for choosing present values, etc.

Specified by:
hasIndex in interface SuppleType
Overrides:
hasIndex in class ContainerTypeImpl

isLegalValueClass

public boolean isLegalValueClass(java.lang.Class c)
Description copied from interface: SuppleType
Check if a class is legal for this type.

Specified by:
isLegalValueClass in interface SuppleType
Overrides:
isLegalValueClass in class ContainerTypeImpl

addDependency

public void addDependency(Reference r)
The execution of an action might require values from other UiObjects, for instance state variables. Or maybe another action is executed as part of this action. We represent these dependencies by storing paths (References) (from this action) to the object we depend on. These paths can be absolute or relative


getDependencies

public java.util.Collection getDependencies()
Description copied from interface: ActionType
Returns a list of all dependencies. These are represented as paths to objects that this action depends on. Refer to the Reference-hierarchy for more information.

Specified by:
getDependencies in interface ActionType

addDynamicObject

public void addDynamicObject(UiObject o)
Stores a new dynamic object that was created by this action.


removeDynamicObject

public void removeDynamicObject(UiObject o)
Removes a dynamic object that was created by this action.


getDynamicObjects

public java.util.Collection getDynamicObjects()
Description copied from interface: ActionType
Returns a Collection of dynamic objects that were created by this action.

Specified by:
getDynamicObjects in interface ActionType

init

protected void init()
Description copied from class: ContainerTypeImpl
Initialize the container type. Executed when object is bound to UiObject.

Overrides:
init in class ContainerTypeImpl

isPrimitiveType

public boolean isPrimitiveType()
Description copied from interface: SuppleType
Test if this is a primitive type.

Specified by:
isPrimitiveType in interface SuppleType
Overrides:
isPrimitiveType in class ContainerTypeImpl