|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.nexttext.behaviour.AbstractBehaviour net.nexttext.behaviour.Behaviour
public class Behaviour
Basic Behaviour class.
Behaviours are used by the Book, to apply Actions to a set of TextObjects.
When the Action indicates that the processing of that object is complete the object is removed from the Behaviour's set of TextObjects.
Constructor Summary | |
---|---|
Behaviour(Action action)
Creates a Behaviour which will perform the specified action. |
Method Summary | |
---|---|
void |
addObject(TextObject to)
Add a TextObject to this Behaviour's list of objects to act on. |
void |
behaveAll()
Calls behave() on every object in its list. |
void |
removeObject(TextObject to)
Stop this behaviour from acting on a TextObject. |
Methods inherited from class net.nexttext.behaviour.AbstractBehaviour |
---|
getDisplayName, setDisplayName, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Behaviour(Action action)
Method Detail |
---|
public void behaveAll()
Objects will be removed from the list if the Action completes.
behaveAll
in class AbstractBehaviour
public void addObject(TextObject to)
AbstractBehaviour
Each Action requires a specific set of properties in TextObjects that it acts on. These properties are added to the TextObjects when they are added to a behaviour for each Action which is a part of that behaviour. Subclasses of AbstractBehaviour have to be sure to perform this necessary step, by overriding this method, (but don't forget to call super.addObject()). Behaviour provides a good example of how to do this.
If the TextObject is already in the set, nothing will be done, a single remove will still remove the object from the list.
addObject
in class AbstractBehaviour
public void removeObject(TextObject to)
removeObject
in class AbstractBehaviour
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |