|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.liu.ida.critiquer.activities.parameters.ActivityParameter<T>
public abstract class ActivityParameter<T>
This class describes the parameters that describe an activity
When creating a plan, we start by choosing the type of activity which in turn gives us a template hierarchy of activities that we can start to manipulate
This structure contains textual information on missions and possibly time dependencies.
Next, resources are assigned to missions in the resource view by dragging resources to missions
When this is done, time intervals for each mission can be calculated in the time view, according to one of several preconfigured settings (launch missions immediately after one another, set certain time slacks)
Therefore, an activity parameter has a view associated with it where one can configure the parameter
Field Summary | |
---|---|
protected boolean |
hasBeenSet
If the user has ever set the value of this parameter, this will be true, otherwise false. |
protected String |
name
|
protected T |
oldValue
|
protected T |
value
|
protected Semaphore |
valueUpdate
|
Constructor Summary | |
---|---|
ActivityParameter(String name,
Activity activity)
|
Method Summary | |
---|---|
Activity |
getActivity()
|
String |
getName()
|
T |
getOldValue()
|
T |
getValue()
|
boolean |
hasValue()
|
(package private) void |
setName(String name)
|
boolean |
setValue(T value)
Update the value of this parameter iff the value is consistent for this parameter The updating is performed with a binary semaphore set so that there can be no more than one thread updating and signalling activities of a value update |
boolean |
setValue(T value,
boolean silent)
This may be used when we don't want to notify activities of the change. |
abstract String |
toString()
|
protected void |
valueChanged()
This method can be used directly by subclasses if the parameter value reference remaing the same but there has been changes to the value so listeners should be notified Also, we create a new thread to do the updating here since this may be called during the process of updating a parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected T value
protected T oldValue
protected boolean hasBeenSet
protected Semaphore valueUpdate
protected String name
Constructor Detail |
---|
public ActivityParameter(String name, Activity activity)
activity
- Method Detail |
---|
public abstract String toString()
toString
in class Object
public T getValue()
getValue
in interface Parameter<T>
public boolean hasValue()
hasValue
in interface Parameter<T>
protected void valueChanged()
public boolean setValue(T value)
value
- The value to set. Sets a value and notifies all listeners
public boolean setValue(T value, boolean silent)
value
- silent
-
public String getName()
void setName(String name)
name
- The name to set.public Activity getActivity()
public T getOldValue()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |