org.tm4j.topicmap.utils
Class TopicUtils

java.lang.Object
  extended byorg.tm4j.topicmap.utils.TopicUtils

public class TopicUtils
extends java.lang.Object

Contains common utilities for working with Topics. These utilities will work correctly with Topics from any backend and the comparison methods (e.g. areEquivalent(Topic, Topic) will work in comparing topics from different providers.


Constructor Summary
TopicUtils()
           
 
Method Summary
static boolean areEquivalent(Topic topic1, Topic topic2)
          Determines topic equivalency.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicUtils

public TopicUtils()
Method Detail

areEquivalent

public static boolean areEquivalent(Topic topic1,
                                    Topic topic2)
Determines topic equivalency. Two topics are considered equal if one or more of the following conditions hold
  1. The topics are from the same parent topic map and have already been merged.
  2. The resourceLocator of the topics are equal
  3. The resourceLocator of one of the topics is equal to on of the subjectIndicators of the other topic.
  4. The subject of the topics are equal
  5. The topics have one or more subjectIndicators in common
  6. The topics have one or more base names with the same base name string in equivalent scopes.