net.ontopia.topicmaps.utils
Class KeyGenerator

java.lang.Object
  extended by net.ontopia.topicmaps.utils.KeyGenerator

public class KeyGenerator
extends java.lang.Object

PUBLIC: Utilities for generating keys from complex topic map objects. The keys from two different objects in the same topic map will be equal if the two objects are equal according to the equality rules of the TMDM.


Constructor Summary
KeyGenerator()
           
 
Method Summary
static java.lang.String makeAssociationKey(AssociationIF assoc)
          PUBLIC: Makes a key for an association.
static java.lang.String makeAssociationKey(AssociationIF assoc, AssociationRoleIF role)
          PUBLIC: Makes a key for an association, but does not include the player of the given role.
static java.lang.String makeAssociationRoleKey(AssociationRoleIF role)
          PUBLIC: Makes a key for an association role.
static java.lang.String makeKey(ReifiableIF object)
          PUBLIC: Makes a key for any reifiable object, using the other methods in this class.
static java.lang.String makeOccurrenceKey(OccurrenceIF occ)
          PUBLIC: Makes a key for an occurrence.
static java.lang.String makeTopicNameKey(TopicNameIF bn)
          PUBLIC: Makes a key for a topic name.
static java.lang.String makeVariantKey(VariantNameIF vn)
          PUBLIC: Makes a key for a variant name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyGenerator

public KeyGenerator()
Method Detail

makeOccurrenceKey

public static java.lang.String makeOccurrenceKey(OccurrenceIF occ)
PUBLIC: Makes a key for an occurrence. The key is made up of a scope key, a type key, and a data key.

Returns:
string containing key

makeTopicNameKey

public static java.lang.String makeTopicNameKey(TopicNameIF bn)
PUBLIC: Makes a key for a topic name. The key is made up of a scope key and a value key.

Returns:
string containing key

makeVariantKey

public static java.lang.String makeVariantKey(VariantNameIF vn)
PUBLIC: Makes a key for a variant name. The key is made up of a scope key and a value/locator key.

Returns:
string containing key
Since:
1.2.0

makeAssociationKey

public static java.lang.String makeAssociationKey(AssociationIF assoc)
PUBLIC: Makes a key for an association. The key is made up from the type and for each role its type and player.

Parameters:
assoc - The association to make a key for
Returns:
string containing key

makeAssociationKey

public static java.lang.String makeAssociationKey(AssociationIF assoc,
                                                  AssociationRoleIF role)
PUBLIC: Makes a key for an association, but does not include the player of the given role. The key is made up from the type and for each role its type and player (except the given role for which only the role type is included). This method is used to create a signature for the association without taking one of the roles into account.

Parameters:
assoc - The association to make a key for
role - The association role whose role player is to be left out of the key.
Returns:
string containing key
Since:
3.4.2

makeAssociationRoleKey

public static java.lang.String makeAssociationRoleKey(AssociationRoleIF role)
PUBLIC: Makes a key for an association role. The key is made up of the role and the player.

Parameters:
role - The association role.
Returns:
The key.
Since:
1.2.0

makeKey

public static java.lang.String makeKey(ReifiableIF object)
PUBLIC: Makes a key for any reifiable object, using the other methods in this class.

Since:
%NEXT%


Copyright © 2000-2009 Ontopia.