public class TMBox
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TMBox.AssociationPlayerComparator
Association comparator that compares associations by comparing topics of
the specified role.
|
static class |
TMBox.AssociationTypeComparator
Sorts associations by
first comparing association types
then if ignoreTopics was specified, compare players of first roles that are not in ignoreTopics
then compare role set sizes
finally compare all roles and players, but only if the fullCompare is set to true, otherwise
comparison ends at previous step, this last step is fairly computationally expensive
as the role lists themselves have to be sorted first
Topic comparisons and player ordering is done with the specified topicComparator.
|
static class |
TMBox.DataValueComparator
A topic comparator that orders topics by the lexicographical ordering of
specified data values.
|
static class |
TMBox.ScopeComparator |
static class |
TMBox.TopicAssociationPlayerComparator
Topic comparator that compares by comparing topics playing a specified role
in an association of specified type.
|
static class |
TMBox.TopicBNAndSIComparator |
static class |
TMBox.TopicNameComparator
A topic comparator that orders topics by their names.
|
static class |
TMBox.TopicSIComparator |
static class |
TMBox.TreeIterator |
static class |
TMBox.TreeIteratorNode |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ASSOCIATIONROLE_SI |
static java.lang.String |
ASSOCIATIONROLECATEGORIES_SI |
static java.lang.String |
ASSOCIATIONTYPE_SI |
static java.lang.String |
CATEGORYHIERARCHY_SI |
static java.lang.String |
ENTRYTIME_SI |
static java.lang.String |
HIDELEVEL_SI |
static java.lang.String |
LANGINDEPENDENT_SI |
static java.lang.String |
LANGUAGE_SI |
static java.lang.String |
OCCURRENCETYPE_SI |
static java.lang.String |
ROLE_SI |
static java.lang.String |
SUBCATEGORY_SI |
static java.lang.String |
SUPERCATEGORY_SI |
static java.lang.String |
VARIANT_NAME_VERSION_SI |
static java.lang.String |
WANDORACLASS_SI |
Constructor and Description |
---|
TMBox() |
Modifier and Type | Method and Description |
---|---|
private static java.util.Collection |
_getSubCategoriesRecursive(Topic t,
java.util.Set c) |
static boolean |
associationVisible(Association a)
Checks if association is visible at visibility level of 1.
|
static boolean |
associationVisible(Association a,
int level)
Checks if association is visible at given level.
|
static java.lang.String |
buildMergeMessage(int a)
Creates a user readable message from an integer that encodes merge/split
information.
|
static ConfirmResult |
checkBaseNameChange(java.awt.Component parent,
Topic topic,
java.lang.String value) |
static ConfirmResult |
checkBaseNameChange(java.awt.Component parent,
Topic topic,
java.lang.String value,
boolean multiple)
Checks if the base name of the given topic can be changed to the given value.
|
static int |
checkBaseNameMerge(Topic t,
java.lang.String newBaseName) |
static ConfirmResult |
checkSubjectIdentifierChange(java.awt.Component parent,
Topic topic,
Locator value,
boolean add) |
static ConfirmResult |
checkSubjectIdentifierChange(java.awt.Component parent,
Topic topic,
Locator value,
boolean add,
boolean multiple)
Checks if a subject identifier can be added or removed from a topic.
|
static int |
checkSubjectIdentifierMerge(Topic t,
Locator subjectIdentifier,
boolean add) |
static ConfirmResult |
checkSubjectLocatorChange(java.awt.Component parent,
Topic topic,
java.lang.String value) |
static ConfirmResult |
checkSubjectLocatorChange(java.awt.Component parent,
Topic topic,
java.lang.String value,
boolean multiple)
Like checkBaseNameChange, checks if the subject locator of the topic can be changed.
|
static int |
checkSubjectLocatorMerge(Topic t,
Locator newSubjectLocator) |
static ConfirmResult |
checkTopicRemove(java.awt.Component parent,
Topic topic) |
static ConfirmResult |
checkTopicRemove(java.awt.Component parent,
Topic topic,
boolean multiple)
Checks if removing a topic will result in a split and warns the user in that case.
|
static boolean |
checkTopicRemoveSplit(Topic t) |
static void |
clearTopicMap(TopicMap topicMap) |
static int |
countAssociationsInCategories(Topic root,
Topic assocType,
Topic role) |
static java.util.HashSet |
countAssociationsInCategories(Topic root,
Topic assocType,
Topic role,
java.util.HashSet topics) |
static java.util.Collection |
getAssociatedTopics(Topic topic,
Topic associationType,
Topic topicRole,
Topic associatedRole,
java.lang.String sortLang) |
static java.util.Stack |
getCategoryPath(Topic t) |
static Topic |
getDisplayNameTopic(Topic t) |
static java.util.HashSet<Topic> |
getGUINameScope(TopicMap tm)
Gets display name scope for English language.
|
static Topic |
getLangTopic(Topic t,
java.lang.String lang) |
static java.lang.String[] |
getLanguageSIs(TopicMap tm)
Gets a subject identifier for each topic that represents some language in
the topic map.
|
static Topic[] |
getLanguageTopics(TopicMap tm) |
static java.lang.String[] |
getNameVersionSIs(TopicMap tm)
Gets a subject identifier for each topic that represents some variant name version in
the topic map.
|
static Topic[] |
getNameVersionTopics(TopicMap tm) |
static Topic |
getOrCreateTopic(TopicMap tm,
java.lang.String si)
Gets the topic with given subject identifier, if such a topic doesn't
exists, makes one.
|
static Topic |
getOrCreateTopic(TopicMap tm,
java.lang.String si,
java.lang.String name)
Gets the topic with given subject identifier, if such a topic doesn't
exists, makes one and sets the given base name.
|
static Topic |
getOrCreateTopicWithBaseName(TopicMap tm,
java.lang.String name)
Gets the topic with given base name, if such a topic doesn't exists,
makes one.
|
static Topic |
getSortNameTopic(Topic t) |
static java.util.Collection |
getSubCategories(Topic t) |
static java.util.Collection |
getSubCategories(Topic t,
java.util.Set c) |
static java.util.Collection |
getSubCategoriesRecursive(Topic t) |
static java.util.Collection |
getSuperCategories(Topic t) |
static java.lang.String |
getTopicDisplayName(Topic topic,
java.lang.String lang) |
static java.lang.String |
getTopicName(Topic topic,
java.util.Set<Topic> scope,
boolean forceSomething) |
static java.lang.String |
getTopicName(Topic topic,
Topic s1,
Topic s2,
boolean forceSomething) |
static java.lang.String |
getTopicSortName(Topic topic,
java.lang.String lang) |
static boolean |
isTopicOfType(Topic topic,
Topic type) |
private static int |
layerSplit(java.util.HashSet<Tuples.T2<Topic,Topic>> links,
java.util.Collection<Topic> topics) |
static void |
mergeTopicMapInOverwriting(TopicMap dest,
TopicMap src)
Merges in a topic map using base names and subject locators from the source
topic map instead of destination topic map whenever topics merge.
|
static java.util.Collection<Association> |
removeDuplicateAssociations(java.util.Collection<Association> associations,
java.util.Collection<Topic> ignoreTopics)
Associations must be sorted first for this to work!
|
static java.util.Collection<Association> |
sortAssociations(java.util.Collection<Association> associations,
java.util.Collection<Topic> ignoreTopics,
java.lang.String lang) |
static java.util.Collection<Association> |
sortAssociations(java.util.Collection<Association> associations,
java.lang.String lang) |
static java.util.Collection<Association> |
sortAssociations(java.util.Collection<Association> associations,
java.lang.String lang,
Topic role) |
static java.util.Collection<Topic> |
sortTopics(java.util.Collection<Topic> topics,
java.lang.String lang)
Sorts a collection of topics by their display names.
|
static Topic[] |
sortTopics(Topic[] topics,
java.lang.String lang)
Sorts an array of topics by their display names.
|
static java.util.Collection<Topic> |
sortTopicsByData(java.util.Collection<Topic> topics,
Topic dataType,
java.lang.String lang)
Sorts an array of topics by occurrence values.
|
static java.util.Collection<Topic> |
sortTopicsByData(java.util.Collection<Topic> topics,
Topic dataType,
java.lang.String lang,
boolean desc)
Sorts a collection of topics by occurrence values.
|
static boolean |
topicVisible(Topic t)
Checks if topic is visible at visibility level of 1.
|
static boolean |
topicVisible(Topic t,
int level)
Checks if topic is visible at given level.
|
static java.util.Iterator |
treeIterator(Topic root,
java.lang.String lang) |
public static final java.lang.String WANDORACLASS_SI
public static final java.lang.String ASSOCIATIONTYPE_SI
public static final java.lang.String ASSOCIATIONROLE_SI
public static final java.lang.String ROLE_SI
public static final java.lang.String LANGINDEPENDENT_SI
public static final java.lang.String ASSOCIATIONROLECATEGORIES_SI
public static final java.lang.String OCCURRENCETYPE_SI
public static final java.lang.String HIDELEVEL_SI
public static final java.lang.String CATEGORYHIERARCHY_SI
public static final java.lang.String SUPERCATEGORY_SI
public static final java.lang.String SUBCATEGORY_SI
public static final java.lang.String ENTRYTIME_SI
public static final java.lang.String VARIANT_NAME_VERSION_SI
public static final java.lang.String LANGUAGE_SI
public static java.lang.String[] getLanguageSIs(TopicMap tm) throws TopicMapException
TopicMapException
public static Topic[] getLanguageTopics(TopicMap tm) throws TopicMapException
TopicMapException
public static java.lang.String[] getNameVersionSIs(TopicMap tm) throws TopicMapException
TopicMapException
public static Topic[] getNameVersionTopics(TopicMap tm) throws TopicMapException
TopicMapException
public static java.util.HashSet<Topic> getGUINameScope(TopicMap tm) throws TopicMapException
TopicMapException
public static java.lang.String buildMergeMessage(int a)
Creates a user readable message from an integer that encodes merge/split information. These kinds of integers are returned by the methods that check if a certain operation will result in a merge or split.
The integer uses four bits to encode the information. If bit 1 is set, changes will be visible in the whole layer stack instead of only in an individual layer. For example merge of two topics in the same layer is not visible in layer stack if those topics were already merged.
If bit 2 is set there will be a real merge in the selected layer. That is, two topics, both in the selected layer, will be merged together.
If bit 4 is set two topics will be merged virtually. There isn't a real merge of topics in any layer but two separate topics are going to be visible as only one topic because of the changes. Note that the topics may be in the same layer or different layers.
If bit 8 is set a topic will be split. There is no operation that would cause a single topic in a layer to be split in two (or more) topics in the same layer. Splits are always virtual, two topics that were visible as one merged topic are going to be visible as separate topics. The topics may be in the same layer or different layers.
Value 0 means that no split or merge will occur. Value 1 is not possible but other values up to and including 15 are possible.
public static ConfirmResult checkBaseNameChange(java.awt.Component parent, Topic topic, java.lang.String value) throws TopicMapException
TopicMapException
public static ConfirmResult checkBaseNameChange(java.awt.Component parent, Topic topic, java.lang.String value, boolean multiple) throws TopicMapException
TopicMapException
public static ConfirmResult checkSubjectLocatorChange(java.awt.Component parent, Topic topic, java.lang.String value) throws TopicMapException
TopicMapException
public static ConfirmResult checkSubjectLocatorChange(java.awt.Component parent, Topic topic, java.lang.String value, boolean multiple) throws TopicMapException
TopicMapException
public static ConfirmResult checkSubjectIdentifierChange(java.awt.Component parent, Topic topic, Locator value, boolean add) throws TopicMapException
TopicMapException
public static ConfirmResult checkSubjectIdentifierChange(java.awt.Component parent, Topic topic, Locator value, boolean add, boolean multiple) throws TopicMapException
TopicMapException
public static ConfirmResult checkTopicRemove(java.awt.Component parent, Topic topic) throws TopicMapException
TopicMapException
public static ConfirmResult checkTopicRemove(java.awt.Component parent, Topic topic, boolean multiple) throws TopicMapException
TopicMapException
private static int layerSplit(java.util.HashSet<Tuples.T2<Topic,Topic>> links, java.util.Collection<Topic> topics)
public static int checkBaseNameMerge(Topic t, java.lang.String newBaseName) throws TopicMapException
TopicMapException
public static int checkSubjectLocatorMerge(Topic t, Locator newSubjectLocator) throws TopicMapException
TopicMapException
public static int checkSubjectIdentifierMerge(Topic t, Locator subjectIdentifier, boolean add) throws TopicMapException
TopicMapException
public static boolean checkTopicRemoveSplit(Topic t) throws TopicMapException
TopicMapException
public static Topic getOrCreateTopic(TopicMap tm, java.lang.String si) throws TopicMapException
TopicMapException
public static Topic getOrCreateTopic(TopicMap tm, java.lang.String si, java.lang.String name) throws TopicMapException
TopicMapException
public static Topic getOrCreateTopicWithBaseName(TopicMap tm, java.lang.String name) throws TopicMapException
TopicMapException
public static void mergeTopicMapInOverwriting(TopicMap dest, TopicMap src) throws TopicMapException
TopicMapException
public static boolean topicVisible(Topic t) throws TopicMapException
TopicMapException
public static boolean topicVisible(Topic t, int level) throws TopicMapException
TopicMapException
public static boolean associationVisible(Association a) throws TopicMapException
TopicMapException
topicVisible(Topic,int)
public static boolean associationVisible(Association a, int level) throws TopicMapException
TopicMapException
topicVisible(Topic,int)
public static int countAssociationsInCategories(Topic root, Topic assocType, Topic role) throws TopicMapException
TopicMapException
public static java.util.HashSet countAssociationsInCategories(Topic root, Topic assocType, Topic role, java.util.HashSet topics) throws TopicMapException
TopicMapException
public static java.util.Iterator treeIterator(Topic root, java.lang.String lang)
public static java.util.Stack getCategoryPath(Topic t) throws TopicMapException
TopicMapException
public static java.util.Collection getSubCategoriesRecursive(Topic t) throws TopicMapException
TopicMapException
private static java.util.Collection _getSubCategoriesRecursive(Topic t, java.util.Set c) throws TopicMapException
TopicMapException
public static java.util.Collection getSubCategories(Topic t, java.util.Set c) throws TopicMapException
TopicMapException
public static java.util.Collection getSubCategories(Topic t) throws TopicMapException
TopicMapException
public static java.util.Collection getSuperCategories(Topic t) throws TopicMapException
TopicMapException
public static java.lang.String getTopicSortName(Topic topic, java.lang.String lang) throws TopicMapException
TopicMapException
public static java.lang.String getTopicDisplayName(Topic topic, java.lang.String lang) throws TopicMapException
TopicMapException
public static java.lang.String getTopicName(Topic topic, Topic s1, Topic s2, boolean forceSomething) throws TopicMapException
TopicMapException
public static java.lang.String getTopicName(Topic topic, java.util.Set<Topic> scope, boolean forceSomething) throws TopicMapException
TopicMapException
public static Topic getLangTopic(Topic t, java.lang.String lang) throws TopicMapException
TopicMapException
public static Topic getDisplayNameTopic(Topic t) throws TopicMapException
TopicMapException
public static Topic getSortNameTopic(Topic t) throws TopicMapException
TopicMapException
public static java.util.Collection getAssociatedTopics(Topic topic, Topic associationType, Topic topicRole, Topic associatedRole, java.lang.String sortLang) throws TopicMapException
TopicMapException
public static boolean isTopicOfType(Topic topic, Topic type) throws TopicMapException
TopicMapException
public static java.util.Collection<Topic> sortTopicsByData(java.util.Collection<Topic> topics, Topic dataType, java.lang.String lang) throws TopicMapException
TopicMapException
public static java.util.Collection<Topic> sortTopicsByData(java.util.Collection<Topic> topics, Topic dataType, java.lang.String lang, boolean desc) throws TopicMapException
TopicMapException
public static Topic[] sortTopics(Topic[] topics, java.lang.String lang)
public static java.util.Collection<Topic> sortTopics(java.util.Collection<Topic> topics, java.lang.String lang)
public static java.util.Collection<Association> sortAssociations(java.util.Collection<Association> associations, java.lang.String lang, Topic role)
public static java.util.Collection<Association> sortAssociations(java.util.Collection<Association> associations, java.lang.String lang)
public static java.util.Collection<Association> sortAssociations(java.util.Collection<Association> associations, java.util.Collection<Topic> ignoreTopics, java.lang.String lang)
public static java.util.Collection<Association> removeDuplicateAssociations(java.util.Collection<Association> associations, java.util.Collection<Topic> ignoreTopics) throws TopicMapException
TopicMapException
public static void clearTopicMap(TopicMap topicMap) throws TopicMapException
TopicMapException
Copyright 2004-2015 Wandora Team