public class TopicMapImpl extends TopicMap
| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<Association> |
associations
All associations in this topic map.
|
private java.util.Map<Topic,java.util.Collection<Association>> |
associationTypeIndex
Indexes associations according to their type.
|
private java.util.List<TopicMapListener> |
disabledListeners |
private static int |
idCounter |
private java.util.Map<java.lang.String,Topic> |
idIndex
Indexes topics according to their id.
|
private java.util.Map<java.lang.String,Topic> |
nameIndex
Indexes topics according to base names.
|
private java.util.Map<Locator,Topic> |
subjectIdentifierIndex
Indexes topics according to subject identifiers.
|
private java.util.Map<Locator,Topic> |
subjectLocatorIndex
Indexes topics according to subject locators.
|
private boolean |
topicMapChanged |
private static int |
topicMapCounter |
private int |
topicMapID |
private java.util.List<TopicMapListener> |
topicMapListeners |
private java.util.Set<Topic> |
topics
All topics in this topic map.
|
private boolean |
trackDependent |
private java.util.Map<Topic,java.util.Collection<Topic>> |
typeIndex
Indexes topics according to their type.
|
consistencyCheck, consistencyCheckWhenXTMImport, EDITTIME_SI, isReadOnly, logger, parentTopicMap| Constructor and Description |
|---|
TopicMapImpl() |
TopicMapImpl(java.lang.String topicmapFile)
Creates a new instance of TopicMapImpl
|
| Modifier and Type | Method and Description |
|---|---|
private Association |
_copyAssociationIn(Association a) |
private Topic |
_copyTopicIn(Topic t,
boolean deep,
boolean stub,
java.util.Hashtable copied) |
private Topic |
_copyTopicIn(Topic t,
boolean deep,
java.util.Hashtable copied) |
void |
addTopicMapListener(TopicMapListener listener)
Adds a topic map listener.
|
void |
addTopicSubjectIdentifier(Topic t,
Locator l) |
void |
addTopicType(Topic t,
Topic type) |
void |
associationChanged(Association a) |
void |
associationPlayerChanged(Association a,
Topic role,
Topic newPlayer,
Topic oldPlayer) |
void |
associationRemoved(Association a) |
void |
associationTypeChanged(Association a,
Topic newType,
Topic oldType) |
void |
checkAssociationConsistency(TopicMapLogger logger)
Checks association consistency and fixes any inconsistencies.
|
void |
clearTopicMap()
Completely clears the topic map.
|
void |
clearTopicMapIndexes()
If the topic map implementation keeps indexes or caches of topics, calling
this method will clear such data structures and cause further methods to
retrieve data directly from the original data source.
|
void |
close()
Close the topic map.
|
protected AssociationImpl |
constructAssociation(Topic type) |
protected TopicImpl |
constructTopic() |
protected TopicImpl |
constructTopic(java.lang.String id) |
Association |
copyAssociationIn(Association a)
Copies an association of a different topic map in this topic map.
|
void |
copyTopicAssociationsIn(Topic t)
Copies all associations of a topic of a different topic map in this topic
map using copyAssociationIn.
|
Topic |
copyTopicIn(Topic t,
boolean deep)
Copies a topic of different topic map in this topic map.
|
Association |
createAssociation(Topic type)
Creates a new association of the given type without any members.
|
Topic |
createTopic()
Creates a new topic without base name, subject identifier, data or any associations.
|
Topic |
createTopic(java.lang.String id)
Creates a new topic without base name, subject identifier, data or any associations.
|
void |
disableAllListeners() |
void |
duplicateAssociationRemoved(Association a,
Association removeda) |
void |
enableAllListeners() |
java.util.Iterator |
getAssociations()
Returns all associations in the topic map.
|
java.util.Collection |
getAssociationsOfType(Topic type)
Returns all associations in the topic map that are of the given type.
|
private int |
getIDCounter() |
int |
getNumAssociations()
Returns the number of associations in topic map.
|
int |
getNumTopics()
Returns the number of topics in topic map.
|
TopicMapStatData |
getStatistics(TopicMapStatOptions options) |
Topic |
getTopic(java.util.Collection SIs) |
Topic |
getTopic(Locator si)
Gets a topic with subject identifier.
|
Topic |
getTopicBySubjectLocator(Locator sl)
Gets a topic with subject locator.
|
java.util.List<TopicMapListener> |
getTopicMapListeners()
Gets all topic map listeners.
|
java.util.Iterator |
getTopics()
Gets all topics in the topic map.
|
Topic[] |
getTopics(java.lang.String[] sis)
Gets the topics whose subject identifiers are given in the array.
|
java.util.Collection |
getTopicsOfType(Topic type)
Gets all topics in the topic map that are of the given type.
|
Topic |
getTopicWithBaseName(java.lang.String name)
Gets a topic with topic base name.
|
java.util.Collection |
getTypeTopics() |
boolean |
isTopicMapChanged()
Checks if the topic map has been changed since the last call to resetTopicMapChanged.
|
void |
mergeIn(TopicMap tm)
Merges the contents of the given topic map in this topic map.
|
void |
removeTopicMapListener(TopicMapListener listener)
Removes a topic map listener.
|
void |
removeTopicSubjectIdentifier(Topic t,
Locator l) |
void |
removeTopicSubjectLocator(Topic t,
Locator l) |
void |
removeTopicType(Topic t,
Topic type) |
boolean |
resetTopicMapChanged() |
java.util.Collection<Topic> |
search(java.lang.String query,
TopicMapSearchOptions options)
Searches the topic map for the given string.
|
private boolean |
searchMatch(java.lang.String s,
java.util.regex.Pattern p) |
void |
setAssociationType(Association a,
Topic type,
Topic oldtype) |
void |
setTopicName(Topic t,
java.lang.String name,
java.lang.String oldname) |
void |
setTopicSubjectLocator(Topic t,
Locator l,
Locator oldLocator) |
void |
setTrackDependent(boolean v)
NOTE: The two trackDependent methods are mostly deprecated.
|
void |
topicBaseNameChanged(Topic t,
java.lang.String newName,
java.lang.String oldName) |
void |
topicChanged(Topic t) |
void |
topicDataChanged(Topic t,
Topic type,
Topic version,
java.lang.String newValue,
java.lang.String oldValue) |
void |
topicRemoved(Topic t) |
void |
topicsMerged(Topic newtopic,
Topic deletedtopic) |
void |
topicSubjectIdentifierChanged(Topic t,
Locator added,
Locator removed) |
void |
topicSubjectLocatorChanged(Topic t,
Locator newLocator,
Locator oldLocator) |
void |
topicTypeChanged(Topic t,
Topic added,
Topic removed) |
void |
topicVariantChanged(Topic t,
java.util.Collection<Topic> scope,
java.lang.String newName,
java.lang.String oldName) |
boolean |
trackingDependent() |
addTopicMapListeners, checkAssociationConsistency, copyTopicCollectionIn, createLocator, createLocator, escapeXML, exportJTM, exportJTM, exportJTM, exportJTM, exportLTM, exportLTM, exportLTM, exportLTM, exportTopicMap, exportTopicMap, exportXTM, exportXTM, exportXTM, exportXTM, exportXTM10, exportXTM10, exportXTM10, exportXTM20, exportXTM20, forceStop, getConsistencyCheck, getLogger, getMergingTopics, getParentTopicMap, getRootTopicMap, getTopic, getTopicBySubjectLocator, getTopics, getTopicsOfType, hlog, importJTM, importJTM, importJTM, importJTM, importJTM, importJTM, importLTM, importLTM, importLTM, importLTM, importLTM, importLTM, importTopicMap, importTopicMap, importTopicMap, importXTM, importXTM, importXTM, importXTM, importXTM, isConnected, isReadOnly, log, log, log, makeJTMString, makeJTMTopicId, makeLTMString, makeLTMTopicId, makeSubjectIndicator, makeSubjectIndicatorAsLocator, mergeIn, setConsistencyCheck, setLogger, setLogTitle, setParentTopicMap, setProgress, setProgressMax, setReadOnlyprivate java.util.List<TopicMapListener> topicMapListeners
private java.util.List<TopicMapListener> disabledListeners
private int topicMapID
private static int topicMapCounter
private java.util.Map<java.lang.String,Topic> idIndex
private java.util.Map<Topic,java.util.Collection<Topic>> typeIndex
private java.util.Map<Locator,Topic> subjectIdentifierIndex
private java.util.Map<Locator,Topic> subjectLocatorIndex
private java.util.Map<java.lang.String,Topic> nameIndex
private java.util.Map<Topic,java.util.Collection<Association>> associationTypeIndex
private java.util.Set<Topic> topics
private java.util.Set<Association> associations
private boolean trackDependent
private boolean topicMapChanged
private static int idCounter
public TopicMapImpl(java.lang.String topicmapFile)
public TopicMapImpl()
public void clearTopicMap()
throws TopicMapException
TopicMapclearTopicMap in class TopicMapTopicMapExceptionpublic void clearTopicMapIndexes()
throws TopicMapException
TopicMapclearTopicMapIndexes in class TopicMapTopicMapExceptionpublic void close()
TopicMappublic void checkAssociationConsistency(TopicMapLogger logger) throws TopicMapException
checkAssociationConsistency in class TopicMapTopicMapExceptionpublic java.util.List<TopicMapListener> getTopicMapListeners()
TopicMapgetTopicMapListeners in class TopicMappublic void addTopicMapListener(TopicMapListener listener)
TopicMapaddTopicMapListener in class TopicMappublic void removeTopicMapListener(TopicMapListener listener)
TopicMapremoveTopicMapListener in class TopicMappublic void disableAllListeners()
disableAllListeners in class TopicMappublic void enableAllListeners()
enableAllListeners in class TopicMapprotected TopicImpl constructTopic(java.lang.String id) throws TopicMapException
TopicMapExceptionprotected TopicImpl constructTopic() throws TopicMapException
TopicMapExceptionpublic Topic createTopic(java.lang.String id) throws TopicMapException
TopicMapcreateTopic in class TopicMapTopicMapExceptionpublic Topic createTopic() throws TopicMapException
TopicMapcreateTopic in class TopicMapTopicMapExceptionprotected AssociationImpl constructAssociation(Topic type) throws TopicMapException
TopicMapExceptionpublic Association createAssociation(Topic type) throws TopicMapException
TopicMapcreateAssociation in class TopicMapTopicMapExceptionpublic Topic getTopic(Locator si) throws TopicMapException
TopicMapgetTopic in class TopicMapTopicMapExceptionpublic Topic getTopicWithBaseName(java.lang.String name) throws TopicMapException
TopicMapgetTopicWithBaseName in class TopicMapTopicMapExceptionpublic java.util.Collection getTopicsOfType(Topic type) throws TopicMapException
TopicMapgetTopicsOfType in class TopicMapTopicMapExceptionpublic java.util.Collection getTypeTopics()
throws TopicMapException
TopicMapExceptionpublic Topic getTopicBySubjectLocator(Locator sl) throws TopicMapException
TopicMapgetTopicBySubjectLocator in class TopicMapTopicMapExceptionpublic java.util.Iterator getTopics()
throws TopicMapException
TopicMapgetTopics in class TopicMapTopicMapExceptionpublic Topic[] getTopics(java.lang.String[] sis) throws TopicMapException
TopicMapgetTopics in class TopicMapTopicMapExceptionpublic java.util.Iterator getAssociations()
throws TopicMapException
TopicMapgetAssociations in class TopicMapTopicMapExceptionpublic java.util.Collection getAssociationsOfType(Topic type) throws TopicMapException
TopicMapgetAssociationsOfType in class TopicMapTopicMapExceptionpublic Topic getTopic(java.util.Collection SIs) throws TopicMapException
TopicMapExceptionprivate int getIDCounter()
private Topic _copyTopicIn(Topic t, boolean deep, java.util.Hashtable copied) throws TopicMapException
TopicMapExceptionprivate Topic _copyTopicIn(Topic t, boolean deep, boolean stub, java.util.Hashtable copied) throws TopicMapException
TopicMapExceptionprivate Association _copyAssociationIn(Association a) throws TopicMapException
TopicMapExceptionpublic Association copyAssociationIn(Association a) throws TopicMapException
TopicMapcopyAssociationIn in class TopicMapTopicMapExceptionpublic Topic copyTopicIn(Topic t, boolean deep) throws TopicMapException
TopicMapcopyTopicIn in class TopicMapTopicMapExceptionpublic void mergeIn(TopicMap tm) throws TopicMapException
TopicMapmergeIn in class TopicMapTopicMapExceptionpublic void copyTopicAssociationsIn(Topic t) throws TopicMapException
TopicMapcopyTopicAssociationsIn in class TopicMapTopicMapExceptionpublic void addTopicSubjectIdentifier(Topic t, Locator l) throws TopicMapException
TopicMapExceptionpublic void removeTopicSubjectIdentifier(Topic t, Locator l) throws TopicMapException
TopicMapExceptionpublic void setTopicSubjectLocator(Topic t, Locator l, Locator oldLocator) throws TopicMapException
TopicMapExceptionpublic void removeTopicSubjectLocator(Topic t, Locator l) throws TopicMapException
TopicMapExceptionpublic void addTopicType(Topic t, Topic type) throws TopicMapException
TopicMapExceptionpublic void removeTopicType(Topic t, Topic type) throws TopicMapException
TopicMapExceptionpublic void setTopicName(Topic t, java.lang.String name, java.lang.String oldname) throws TopicMapException
TopicMapExceptionpublic void setAssociationType(Association a, Topic type, Topic oldtype) throws TopicMapException
TopicMapExceptionpublic void topicRemoved(Topic t) throws TopicMapException
TopicMapExceptionpublic void associationRemoved(Association a) throws TopicMapException
TopicMapExceptionpublic void duplicateAssociationRemoved(Association a, Association removeda)
public int getNumAssociations()
throws TopicMapException
TopicMapgetNumAssociations in class TopicMapTopicMapExceptionpublic int getNumTopics()
throws TopicMapException
TopicMapgetNumTopics in class TopicMapTopicMapExceptionpublic boolean trackingDependent()
trackingDependent in class TopicMappublic void setTrackDependent(boolean v)
TopicMapsetTrackDependent in class TopicMappublic void topicSubjectIdentifierChanged(Topic t, Locator added, Locator removed) throws TopicMapException
TopicMapExceptionpublic void topicBaseNameChanged(Topic t, java.lang.String newName, java.lang.String oldName) throws TopicMapException
TopicMapExceptionpublic void topicTypeChanged(Topic t, Topic added, Topic removed) throws TopicMapException
TopicMapExceptionpublic void topicVariantChanged(Topic t, java.util.Collection<Topic> scope, java.lang.String newName, java.lang.String oldName) throws TopicMapException
TopicMapExceptionpublic void topicDataChanged(Topic t, Topic type, Topic version, java.lang.String newValue, java.lang.String oldValue) throws TopicMapException
TopicMapExceptionpublic void topicSubjectLocatorChanged(Topic t, Locator newLocator, Locator oldLocator) throws TopicMapException
TopicMapExceptionpublic void topicChanged(Topic t) throws TopicMapException
TopicMapExceptionpublic void associationTypeChanged(Association a, Topic newType, Topic oldType) throws TopicMapException
TopicMapExceptionpublic void associationPlayerChanged(Association a, Topic role, Topic newPlayer, Topic oldPlayer) throws TopicMapException
TopicMapExceptionpublic void associationChanged(Association a) throws TopicMapException
TopicMapExceptionpublic boolean resetTopicMapChanged()
resetTopicMapChanged in class TopicMapTopicMap.isTopicMapChanged()public boolean isTopicMapChanged()
TopicMapisTopicMapChanged in class TopicMappublic java.util.Collection<Topic> search(java.lang.String query, TopicMapSearchOptions options) throws TopicMapException
TopicMapsearch in class TopicMapTopicMapExceptionprivate boolean searchMatch(java.lang.String s,
java.util.regex.Pattern p)
public TopicMapStatData getStatistics(TopicMapStatOptions options) throws TopicMapException
getStatistics in class TopicMapTopicMapExceptionCopyright 2004-2015 Wandora Team