org.tm4j.topicmap.utils.extractors .AssociationNameExtractor

Description

This class implements both a BinaryFunction and a UnaryFunction that return a name string for an Association instance.

The UnaryFunction implementation returns an arbitrary base name string from the Association's typing topic.

The BinaryFunction implementation takes the Association instance as the first parameter, and a Topic instance as the second parameter where the Topic instance MUST be a role player in the Association. The function then returns a base name string from the Association's typing topic that is scoped by the topic that defines the type of the role played by the Topic in the other parameter.

For example, given a TopicMap that includes the following (in XTM syntax):

Born In Birthplace Of ]]>

A call to this extractor with the association as the only parameter will return the unscoped base name string "Born In". A call to this extractor with the association as the first parameter and the topic "joe-strummer" as the second parameter will return the unscoped base name string "Born In". A call to this extractor with the association as the first parameter and the topic "ankara" as the second parameter will return the base name string "Birthplace Of" as it is scoped by the topic that types the role played by "ankara" in the association (i.e. the topic "place").

Inheritance Hierarchy

Method Summary
java.lang.Object _extract(java.lang.Object in)
java.lang.Object fn(java.lang.Object in,java.lang.Object arg)
java.lang.String getName(org.tm4j.topicmap.Association in,org.tm4j.topicmap.Topic dominantPlayer)