|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.interact.InteractorGroup
An interactor representing a group of interactors, in a composite pattern. An interactor group propagates its interaction state to its member interactors, assuring consistency of interaction state throughout the group. The interactors in an interactor group must have update policies that are mutually compatible with that of this group's interactor state.
An interactor can be a member of none or more groups. As such, interactor groups can serve as different interaction "roles" for the same interactor. For example, one interactor group can serve the role of "self", which includes all interactors representing a given data model in different views. Another interactor group can serve the role of "command selection", which includes all multi-selected command target interactors. And, another interactor group can serve the role of "aspect selection", which includes all interactors associated with the members of an aspect model. When used to support roles, the interactor group should use partial state updates.
Constructor Summary | |
InteractorGroup()
Creates an instance, with a default InteractorState and partial state propagation. |
|
InteractorGroup(InteractorState state,
boolean partial)
Creates an instance, with a new interactor state as this group's state. |
Method Summary | |
boolean |
addMember(Interactor member,
boolean sync)
Adds an interactor as a member of this group. |
void |
clearMembers(boolean desync)
Convenience method that removes all members from this group. |
boolean |
equals(java.lang.Object obj)
|
InteractorGroup |
getInteractorGroup()
Gets a singleton immutable view of this object with the same identity (hashCode(), equals()) as this object. |
InteractorState |
getInteractorState()
Gets the interactor state value for this interactor. |
java.util.Set |
getMembers()
Returns an immutable view of the members of this group. |
boolean |
isPartialUpdate()
|
boolean |
removeMember(Interactor member,
boolean desync)
Removes an interactor as a member from this group. |
void |
syncMembers()
Syncs the members of this group with this group's current state value (full or partial). |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public InteractorGroup()
public InteractorGroup(InteractorState state, boolean partial)
state
- New interactor state. If null, a default InteractorState
is used (see InteractorState).partial
- If true, state updates are propagated to members
as partial "masked changes" (see StateSet.change(StateSet));
otherwise, the full state is propagated. This does not
affect state resets, which always propagate the full state.
Unless this group has exclusive control over its members, should be
true (partial state update).Method Detail |
public boolean isPartialUpdate()
public InteractorGroup getInteractorGroup()
public boolean addMember(Interactor member, boolean sync)
member
- Member to be added. Silently ignores null and duplicate
members.sync
- If true, the new member's state is synced (full or partial)
with that of this group.
java.lang.IllegalArgumentException
- Can't add this group to itself.public boolean removeMember(Interactor member, boolean desync)
member
- Member to be removed. Silently ignores null and missing
members.desync
- If true, the old member's state is desynced by removing
this group's state (full or partial).
public void clearMembers(boolean desync)
desync
- If true, the old member's state is desynced by removing
this group's state (full or partial).public java.util.Set getMembers()
public void syncMembers()
public InteractorState getInteractorState()
Interactor
getInteractorState
in interface Interactor
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |