Package net.ontopia.topicmaps.utils
Class KeyGenerator
- java.lang.Object
-
- net.ontopia.topicmaps.utils.KeyGenerator
-
public class KeyGenerator extends 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
Constructors Constructor Description KeyGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringmakeAssociationKey(AssociationIF assoc)PUBLIC: Makes a key for an association.static StringmakeAssociationKey(AssociationIF assoc, AssociationRoleIF role)PUBLIC: Makes a key for an association, but does not include the player of the given role.static StringmakeAssociationKey(AssociationIF assoc, TopicMapIF othertm)PUBLIC: Makes a key for an association, as it would look in another topic map.static StringmakeAssociationRoleKey(AssociationRoleIF role)PUBLIC: Makes a key for an association role.static StringmakeAssociationRoleKey(AssociationRoleIF role, TopicMapIF othertm)PUBLIC: Makes a key for an association role, as it would look in another topic map.protected static StringmakeDataKey(OccurrenceIF occ)protected static StringmakeDataKey(VariantNameIF variant)static StringmakeKey(ReifiableIF object)PUBLIC: Makes a key for any reifiable object, using the other methods in this class.static StringmakeKey(ReifiableIF object, TopicMapIF topicmap)PUBLIC: Makes a key for any reifiable object as it would look like were the object in another topic map.static StringmakeOccurrenceKey(OccurrenceIF occ)PUBLIC: Makes a key for an occurrence.static StringmakeOccurrenceKey(OccurrenceIF occ, TopicMapIF othertm)PUBLIC: Makes a key for an occurrence, as it would look in another topic map.protected static StringmakeScopeKey(Collection<TopicIF> scope)protected static StringmakeScopeKey(Collection<TopicIF> scope, TopicMapIF othertm)protected static StringmakeScopeKey(ScopedIF scoped)protected static StringmakeScopeKey(ScopedIF scoped, TopicMapIF othertm)protected static StringmakeTopicKey(TopicIF topic)static StringmakeTopicNameKey(TopicNameIF bn)PUBLIC: Makes a key for a topic name.static StringmakeTopicNameKey(TopicNameIF bn, TopicMapIF othertm)PUBLIC: Makes a key for a topic name, as it would look in another topic map.protected static StringmakeTypedKey(TypedIF typed)protected static StringmakeTypedKey(TypedIF typed, TopicMapIF othertm)static StringmakeVariantKey(VariantNameIF vn)PUBLIC: Makes a key for a variant name.
-
-
-
Method Detail
-
makeOccurrenceKey
public static 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
-
makeOccurrenceKey
public static String makeOccurrenceKey(OccurrenceIF occ, TopicMapIF othertm)
PUBLIC: Makes a key for an occurrence, as it would look in another topic map.- Returns:
- string containing key
- Since:
- 5.1.3
-
makeTopicNameKey
public static 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
-
makeTopicNameKey
public static String makeTopicNameKey(TopicNameIF bn, TopicMapIF othertm)
PUBLIC: Makes a key for a topic name, as it would look in another topic map.- Returns:
- string containing key
- Since:
- 5.1.3
-
makeVariantKey
public static 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 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 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 forrole- The association role whose role player is to be left out of the key.- Returns:
- string containing key
- Since:
- 3.4.2
-
makeAssociationKey
public static String makeAssociationKey(AssociationIF assoc, TopicMapIF othertm)
PUBLIC: Makes a key for an association, as it would look in another topic map.- Since:
- 5.1.3
-
makeAssociationRoleKey
public static 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
-
makeAssociationRoleKey
public static String makeAssociationRoleKey(AssociationRoleIF role, TopicMapIF othertm)
PUBLIC: Makes a key for an association role, as it would look in another topic map.- Since:
- 5.1.3
-
makeKey
public static String makeKey(ReifiableIF object)
PUBLIC: Makes a key for any reifiable object, using the other methods in this class.- Since:
- 5.1.0
-
makeKey
public static String makeKey(ReifiableIF object, TopicMapIF topicmap)
PUBLIC: Makes a key for any reifiable object as it would look like were the object in another topic map. Useful for checking if a given object exists in another topic map.- Parameters:
object- The object to make a key for.topicmap- The topic map in which to interpret the key.- Since:
- 5.1.3
-
makeTypedKey
protected static String makeTypedKey(TypedIF typed, TopicMapIF othertm)
-
makeScopeKey
protected static String makeScopeKey(ScopedIF scoped, TopicMapIF othertm)
-
makeScopeKey
protected static String makeScopeKey(Collection<TopicIF> scope)
-
makeScopeKey
protected static String makeScopeKey(Collection<TopicIF> scope, TopicMapIF othertm)
-
makeDataKey
protected static String makeDataKey(OccurrenceIF occ)
-
makeDataKey
protected static String makeDataKey(VariantNameIF variant)
-
-