public class UndoTopicMap extends TopicMap
Modifier and Type | Class and Description |
---|---|
private class |
UndoTopicMap.TopicMapListenerWrapper |
Modifier and Type | Field and Description |
---|---|
private java.util.WeakHashMap<Topic,java.lang.ref.WeakReference<UndoTopic>> |
topicIndex |
private UndoBuffer |
undoBuffer |
private boolean |
undoDisabled |
private TopicMap |
wrapped |
private java.util.HashMap<TopicMapListener,UndoTopicMap.TopicMapListenerWrapper> |
wrappedListeners |
consistencyCheck, consistencyCheckWhenXTMImport, EDITTIME_SI, isReadOnly, logger, parentTopicMap
Constructor and Description |
---|
UndoTopicMap(TopicMap wrapped) |
UndoTopicMap(TopicMap wrapped,
boolean skipEmptyOperations) |
Modifier and Type | Method and Description |
---|---|
void |
addTopicMapListener(TopicMapListener listener)
Adds a topic map listener.
|
(package private) void |
addUndoOperation(UndoOperation op) |
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 |
clearUndoBuffer() |
void |
close()
Close the topic map.
|
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 |
enableAllListeners() |
java.util.Iterator<Association> |
getAssociations()
Returns all associations in the topic map.
|
java.util.Collection<Association> |
getAssociationsOfType(Topic type)
Returns all associations in the topic map that are of the given type.
|
boolean |
getConsistencyCheck() |
int |
getNumAssociations()
Returns the number of associations in topic map.
|
int |
getNumTopics()
Returns the number of topics in topic map.
|
TopicMap |
getParentTopicMap()
Gets the parent of this topic map.
|
TopicMap |
getRootTopicMap()
Gets the root topic map.
|
TopicMapStatData |
getStatistics(TopicMapStatOptions options) |
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<Topic> |
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<Topic> |
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.
|
UndoBuffer |
getUndoBuffer() |
TopicMap |
getWrappedTopicMap() |
void |
handleUndoException(UndoException ue) |
boolean |
isConnected()
Checks if this topic map is connected to the service providing the topic map.
|
boolean |
isReadOnly()
Checks if the topic map is in a read only state.
|
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 |
mergeIn(TopicMap tm,
TopicMapLogger tmLogger)
Merges the contents of the given topic map in this topic map.
|
void |
removeTopicMapListener(TopicMapListener listener)
Removes a topic map listener.
|
boolean |
resetTopicMapChanged() |
java.util.Collection<Topic> |
search(java.lang.String query,
TopicMapSearchOptions options)
Searches the topic map for the given string.
|
void |
setConsistencyCheck(boolean value)
Set consistency check of associations on or off.
|
void |
setParentTopicMap(TopicMap parent)
Sets the parent of this topic map.
|
void |
setReadOnly(boolean readOnly)
Sets the topic map in a read-only or read-write state depending on the
argument.
|
void |
setTrackDependent(boolean v)
NOTE: The two trackDependent methods are mostly deprecated.
|
void |
setUndoDisabled(boolean value) |
boolean |
trackingDependent() |
(package private) Association |
wrapAssociation(Association a) |
(package private) java.util.Collection<Association> |
wrapAssociations(java.util.Collection<Association> as) |
(package private) UndoTopic |
wrapTopic(Topic t) |
(package private) java.util.ArrayList<Topic> |
wrapTopics(java.util.Collection<Topic> topics) |
(package private) Topic[] |
wrapTopics(Topic[] topics) |
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, getLogger, getMergingTopics, 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, log, log, log, makeJTMString, makeJTMTopicId, makeLTMString, makeLTMTopicId, makeSubjectIndicator, makeSubjectIndicatorAsLocator, setLogger, setLogTitle, setProgress, setProgressMax
private TopicMap wrapped
private UndoBuffer undoBuffer
private boolean undoDisabled
private final java.util.WeakHashMap<Topic,java.lang.ref.WeakReference<UndoTopic>> topicIndex
private java.util.HashMap<TopicMapListener,UndoTopicMap.TopicMapListenerWrapper> wrappedListeners
public UndoTopicMap(TopicMap wrapped, boolean skipEmptyOperations)
public UndoTopicMap(TopicMap wrapped)
public void close()
TopicMap
public void setUndoDisabled(boolean value)
public UndoBuffer getUndoBuffer()
public TopicMap getWrappedTopicMap()
public void handleUndoException(UndoException ue)
void addUndoOperation(UndoOperation op)
Association wrapAssociation(Association a)
java.util.Collection<Association> wrapAssociations(java.util.Collection<Association> as)
public TopicMap getParentTopicMap()
TopicMap
getParentTopicMap
in class TopicMap
public TopicMap getRootTopicMap()
TopicMap
getRootTopicMap
in class TopicMap
public void setParentTopicMap(TopicMap parent)
TopicMap
setParentTopicMap
in class TopicMap
public Topic getTopic(Locator si) throws TopicMapException
TopicMap
getTopic
in class TopicMap
TopicMapException
public Topic getTopicBySubjectLocator(Locator sl) throws TopicMapException
TopicMap
getTopicBySubjectLocator
in class TopicMap
TopicMapException
public Topic createTopic(java.lang.String id) throws TopicMapException
TopicMap
createTopic
in class TopicMap
TopicMapException
public Topic createTopic() throws TopicMapException
TopicMap
createTopic
in class TopicMap
TopicMapException
public Association createAssociation(Topic type) throws TopicMapException
TopicMap
createAssociation
in class TopicMap
TopicMapException
public java.util.Collection<Topic> getTopicsOfType(Topic type) throws TopicMapException
TopicMap
getTopicsOfType
in class TopicMap
TopicMapException
public Topic getTopicWithBaseName(java.lang.String name) throws TopicMapException
TopicMap
getTopicWithBaseName
in class TopicMap
TopicMapException
public java.util.Iterator<Topic> getTopics() throws TopicMapException
TopicMap
getTopics
in class TopicMap
TopicMapException
public Topic[] getTopics(java.lang.String[] sis) throws TopicMapException
TopicMap
getTopics
in class TopicMap
TopicMapException
public java.util.Iterator<Association> getAssociations() throws TopicMapException
TopicMap
getAssociations
in class TopicMap
TopicMapException
public java.util.Collection<Association> getAssociationsOfType(Topic type) throws TopicMapException
TopicMap
getAssociationsOfType
in class TopicMap
TopicMapException
public int getNumTopics() throws TopicMapException
TopicMap
getNumTopics
in class TopicMap
TopicMapException
public int getNumAssociations() throws TopicMapException
TopicMap
getNumAssociations
in class TopicMap
TopicMapException
public Topic copyTopicIn(Topic t, boolean deep) throws TopicMapException
TopicMap
copyTopicIn
in class TopicMap
TopicMapException
public Association copyAssociationIn(Association a) throws TopicMapException
TopicMap
copyAssociationIn
in class TopicMap
TopicMapException
public void copyTopicAssociationsIn(Topic t) throws TopicMapException
TopicMap
copyTopicAssociationsIn
in class TopicMap
TopicMapException
public void setTrackDependent(boolean v) throws TopicMapException
TopicMap
setTrackDependent
in class TopicMap
TopicMapException
public boolean trackingDependent() throws TopicMapException
trackingDependent
in class TopicMap
TopicMapException
public void addTopicMapListener(TopicMapListener listener)
TopicMap
addTopicMapListener
in class TopicMap
public void removeTopicMapListener(TopicMapListener listener)
TopicMap
removeTopicMapListener
in class TopicMap
public java.util.List<TopicMapListener> getTopicMapListeners()
TopicMap
getTopicMapListeners
in class TopicMap
public void disableAllListeners()
disableAllListeners
in class TopicMap
public void enableAllListeners()
enableAllListeners
in class TopicMap
public boolean isTopicMapChanged() throws TopicMapException
TopicMap
isTopicMapChanged
in class TopicMap
TopicMapException
public boolean resetTopicMapChanged() throws TopicMapException
resetTopicMapChanged
in class TopicMap
TopicMapException
TopicMap.isTopicMapChanged()
public java.util.Collection<Topic> search(java.lang.String query, TopicMapSearchOptions options) throws TopicMapException
TopicMap
search
in class TopicMap
TopicMapException
public TopicMapStatData getStatistics(TopicMapStatOptions options) throws TopicMapException
getStatistics
in class TopicMap
TopicMapException
public void clearUndoBuffer()
public void clearTopicMap() throws TopicMapException
TopicMap
clearTopicMap
in class TopicMap
TopicMapException
public void clearTopicMapIndexes() throws TopicMapException
TopicMap
clearTopicMapIndexes
in class TopicMap
TopicMapException
public void checkAssociationConsistency(TopicMapLogger logger) throws TopicMapException
TopicMap
checkAssociationConsistency
in class TopicMap
TopicMapException
public boolean getConsistencyCheck() throws TopicMapException
getConsistencyCheck
in class TopicMap
TopicMapException
public boolean isConnected() throws TopicMapException
TopicMap
isConnected
in class TopicMap
TopicMapException
public void setReadOnly(boolean readOnly)
TopicMap
setReadOnly
in class TopicMap
public boolean isReadOnly()
TopicMap
isReadOnly
in class TopicMap
public void setConsistencyCheck(boolean value) throws TopicMapException
TopicMap
Set consistency check of associations on or off. This should normally be turned on but you may turn it off before some big batch operations to speed them up. After this operation you need to turn the consistency check back on and manually call checkAssociationConsistency unless you are sure that the operation did not cause any incensistencies with associations.
Note that some implementations may not allow turning consistency check off so getConsistencyCheck may return a different value that the last parameter used for setConsistencyCheck. If turning consistency check off is not supported, then it is also not needed to manually call the checkAssociationConsistency.
setConsistencyCheck
in class TopicMap
TopicMapException
TopicMap.checkAssociationConsistency(TopicMapLogger)
public void mergeIn(TopicMap tm) throws TopicMapException
TopicMap
mergeIn
in class TopicMap
TopicMapException
public void mergeIn(TopicMap tm, TopicMapLogger tmLogger) throws TopicMapException
TopicMap
mergeIn
in class TopicMap
TopicMapException
Copyright 2004-2015 Wandora Team