org.tm4j.topicmap.utils
Class ScopeUtils

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

public class ScopeUtils
extends java.lang.Object


Constructor Summary
ScopeUtils()
           
 
Method Summary
static boolean areEquivalent(java.util.Set scope1, java.util.Set scope2)
          Tests whether two Scope objects represent equivalent scopes according to the "Scope equality principle" of XTM 1.0 section F.2.3.
static java.lang.String getSignature(java.util.Set s)
          Returns a string signature for the scope.
static java.lang.String getThemesSignature(java.util.Collection themes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopeUtils

public ScopeUtils()
Method Detail

getSignature

public static java.lang.String getSignature(java.util.Set s)
Returns a string signature for the scope. This signature will be the same for any scope object which contains exactly the same set of themes.

Parameters:
s - a set of Topic objects making up a scope to return the signature for

getThemesSignature

public static java.lang.String getThemesSignature(java.util.Collection themes)

areEquivalent

public static boolean areEquivalent(java.util.Set scope1,
                                    java.util.Set scope2)
Tests whether two Scope objects represent equivalent scopes according to the "Scope equality principle" of XTM 1.0 section F.2.3. This section states that: "In a consistent topic map a conformant XTM processor must consider two scopes equal if they contain the same set of topics."

Parameters:
scope1 - a scope to be compared
scope2 - a scope to be compared
Returns:
True if the scopes are equivalent, false otherwise