|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.topicmaps.utils.MergeUtils
public class MergeUtils
PUBLIC: Utilities for merging topics and topic maps. This class provides static methods for testing whether topics should be merged, merging topics and for merging topic maps.
Constructor Summary | |
---|---|
MergeUtils()
|
Method Summary | |
---|---|
static TopicIF |
copyIdentifiers(TopicIF target,
TopicIF source)
INTERNAL: Copies all the identifiers from the source to the target topic. |
static TopicIF |
copyIdentifiers(TopicIF target,
TopicIF source,
java.util.Map mergemap)
|
static TopicIF |
findTopic(TopicMapIF othertm,
TopicIF topic)
PUBLIC: Find a topic in the other topic map which would merge with the given topic if that were to be added to the same topic map. |
static void |
mergeInto(AssociationIF target,
AssociationIF source)
PUBLIC: Merges the source association into the target association. |
static void |
mergeInto(AssociationRoleIF target,
AssociationRoleIF source)
PUBLIC: Merges the source role into the target role. |
static void |
mergeInto(OccurrenceIF target,
OccurrenceIF source)
PUBLIC: Merges the source occurrence into the target occurrence. |
static void |
mergeInto(ReifiableIF target,
ReifiableIF source)
PUBLIC: Merges the source object into the target object. |
static OccurrenceIF |
mergeInto(TopicIF target,
OccurrenceIF source)
PUBLIC: Merges the source occurrence into the target topic in another topic map. |
static ReifiableIF |
mergeInto(TopicIF target,
ReifiableIF source)
PUBLIC: Merges the source object into a target topic in another topic map. |
static void |
mergeInto(TopicIF target,
TopicIF source)
PUBLIC: Merges the characteristics of one topic into another topic. |
static TopicNameIF |
mergeInto(TopicIF target,
TopicNameIF source)
PUBLIC: Merges the source topic name into the target topic in another topic map. |
static AssociationIF |
mergeInto(TopicMapIF topicmap,
AssociationIF source)
PUBLIC: Merges the source association into the target topic map. |
static TopicIF |
mergeInto(TopicMapIF targettm,
TopicIF source)
PUBLIC: Merges the source topic from into the target topic map, when the source topic is not already in the target topic map. |
static TopicIF |
mergeInto(TopicMapIF targettm,
TopicIF source,
DeciderIF decider)
PUBLIC: Merges the source topic from into the target topic map, when the source topic is not already in the target topic map. |
static void |
mergeInto(TopicMapIF target,
TopicMapIF source)
PUBLIC: Merges one topic map into another topic map. |
static void |
mergeInto(TopicNameIF target,
TopicNameIF source)
PUBLIC: Merges the source name into the target name. |
static void |
mergeInto(VariantNameIF target,
VariantNameIF source)
PUBLIC: Merges the source variant into the target variant. |
static boolean |
shouldMerge(TopicIF t1,
TopicIF t2)
PUBLIC: Tests whether two topics should be merged or not, according to XTM rules. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MergeUtils()
Method Detail |
---|
public static boolean shouldMerge(TopicIF t1, TopicIF t2)
t1
- topicIF; #1 topic to merget2
- topicIF; #2 topic to merge
public static void mergeInto(TopicIF target, TopicIF source) throws ConstraintViolationException
source
- topicIF; the source topic. This is empty after the
operation and is removed from the topic map.target
- topicIF; the target topic. This gets new characteristics.
throws
- ConstraintViolationException if the two topics
have different values for the 'subject' property, since if they
do they cannot represent the same subject. If this exception is
thrown both topics remain untouched.
ConstraintViolationException
public static void mergeInto(TopicNameIF target, TopicNameIF source)
public static void mergeInto(OccurrenceIF target, OccurrenceIF source)
public static void mergeInto(AssociationIF target, AssociationIF source)
public static void mergeInto(AssociationRoleIF target, AssociationRoleIF source)
public static void mergeInto(VariantNameIF target, VariantNameIF source)
public static void mergeInto(ReifiableIF target, ReifiableIF source)
public static ReifiableIF mergeInto(TopicIF target, ReifiableIF source)
public static TopicNameIF mergeInto(TopicIF target, TopicNameIF source)
public static OccurrenceIF mergeInto(TopicIF target, OccurrenceIF source)
public static AssociationIF mergeInto(TopicMapIF topicmap, AssociationIF source)
public static TopicIF mergeInto(TopicMapIF targettm, TopicIF source)
public static TopicIF mergeInto(TopicMapIF targettm, TopicIF source, DeciderIF decider)
decider
- Used to decide which topic characteristics to copy.
Is asked for each base name, occurrence, and association role.public static TopicIF copyIdentifiers(TopicIF target, TopicIF source)
public static TopicIF copyIdentifiers(TopicIF target, TopicIF source, java.util.Map mergemap)
public static void mergeInto(TopicMapIF target, TopicMapIF source) throws ConstraintViolationException
Merges are done on the basis of subject locators, subject identifiers, item identifiers, and topic names (with scope).
source
- topicIF; the source topic map. This is untouched after the
operation.target
- topicIF; the target topic map. This gets new topics
and topic characteristics.
throws
- ConstraintViolationException if two topics
that are to be merged under XTM 1.0 rules have different values
for the 'subject' property, since if they do they cannot
represent the same subject.
ConstraintViolationException
public static TopicIF findTopic(TopicMapIF othertm, TopicIF topic)
othertm
- The topic map to find the corresponding topic in.topic
- A topic in a topic map other than othertm to look up
in othertm.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |