|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ontopia.topicmaps.utils.AssociationWalker
public class AssociationWalker
PUBLIC: Computes the transitive closure of a relation characterized by two specific roles within a specific association type.
The relation is characterized by an association type A and a pair of roles R1 & R2 such that two topics T1 and T2 are related if T1 plays role R1 and T2 plays role R2 in an association A. A transitive relation is where "x is related to y" and "y is related to z" always implies that "x is related to z" Here, an association type, together with two roles within that type of association, is taken as the relation which is transitive. In topic map terms, if: T1 plays role R1 in association A1 and T2 plays role R2 in association A1 and: T2 plays role R1 in association A2 and T3 plays role R2 in association A2 then: T1 and T3 are also (transitively) related.
Constructor Summary | |
---|---|
AssociationWalker(DeciderIF assocDecider,
DeciderIF fromRoleDecider,
DeciderIF toRoleDecider)
PUBLIC: Creates a walker which uses deciders to traverse the associations. |
|
AssociationWalker(TopicIF associationType,
TopicIF leftRoleSpec,
TopicIF rightRoleSpec)
PUBLIC: Creates a walker which determines that a topic A is related to topic B if A plays a role specified by leftRoleSpec in an association of type
associationType and topic B plays a role specified
by rightRoleSpec in the same association. |
Method Summary | |
---|---|
void |
addListener(AssociationWalkerListenerIF listener)
PUBLIC: Registers a listener with the walker. |
boolean |
isAssociated(TopicIF start,
TopicIF associated)
PUBLIC: Returns true if the two topics are directly or indirectly associated under the association type and rolespec definitions provided in the constructor for this walker. |
void |
removeListener(AssociationWalkerListenerIF listener)
PUBLIC: Unregisters a listener with the walker. |
java.util.Collection |
walkPaths(TopicIF start)
PUBLIC: Computes the transitive closure under the association type and rolespec definitions provided in the constructor, and returns a set containing the paths taken through the topic map in computing the closure. |
java.util.Set |
walkTopics(TopicIF start)
PUBLIC: Computes the transitive closure under the association type and rolespec definitions provided in the constructor, and returns the result as a set of topics. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AssociationWalker(TopicIF associationType, TopicIF leftRoleSpec, TopicIF rightRoleSpec)
leftRoleSpec
in an association of type
associationType
and topic B plays a role specified
by rightRoleSpec
in the same association.
associationType
- The given association type; an object
implementing TopicIF.leftRoleSpec
- The first given association rolespec; an
object implementing TopicIF.rightRoleSpec
- The second given association rolespec; an
object implementing TopicIF.public AssociationWalker(DeciderIF assocDecider, DeciderIF fromRoleDecider, DeciderIF toRoleDecider)
assocDecider
- ; an object implementing DeciderIF.fromRoleDecider
- ; an object implementing DeciderIF.toRoleDecider
- ; an object implementing DeciderIF.Method Detail |
---|
public java.util.Set walkTopics(TopicIF start)
start
- The topic to start the computation from; an object
implementing TopicIF.
public java.util.Collection walkPaths(TopicIF start)
start
- The topic to start the computation from; an object
implementing TopicIF.
public boolean isAssociated(TopicIF start, TopicIF associated)
start
- The topic to begin computation from; an object implementing TopicIF.associated
- The topic to be found in the association; an object implementing TopicIF.
public void addListener(AssociationWalkerListenerIF listener)
listener
- The listener to be registered; an object
implementing AssociationWalkerListenerIF.AssociationWalkerListenerIF
public void removeListener(AssociationWalkerListenerIF listener)
listener
- The listener to be unregistered; an object
implementing AssociationWalkerListenerIF.AssociationWalkerListenerIF
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |