public class TopicMap extends TMObject implements TopicMapIF, EventManagerIF
Modifier and Type | Field and Description |
---|---|
protected Set<AssociationIF> |
assocs |
protected CollectionFactoryIF |
cfactory |
protected Map<String,EventListenerIF[]> |
listeners |
protected TopicIF |
reifier |
protected UniqueSet<TopicIF> |
scope |
UniqueSet<TopicIF> |
setpool |
protected SubjectIdentityCache |
sicache |
protected Set<TopicIF> |
topics |
protected InMemoryTopicMapTransaction |
txn |
oid, parent, sources, topicmap
EVENT_ADD_ASSOCIATION, EVENT_ADD_TOPIC, EVENT_REMOVE_ASSOCIATION, EVENT_REMOVE_TOPIC
EVENT_SET_REIFIER
EVENT_ADD_ITEMIDENTIFIER, EVENT_REMOVE_ITEMIDENTIFIER, MSG_NULL_ARGUMENT
Modifier and Type | Method and Description |
---|---|
void |
addAssociation(AssociationIF _association)
Adds an association to the set of associations.
|
void |
addListener(EventListenerIF listener,
String event)
INTERNAL: Register the listener as a listener for the event.
|
void |
addTopic(TopicIF _topic)
Adds a topic to the set of topics.
|
void |
clear()
PUBLIC: Clears the topic map by removing all topics and associations.
|
protected void |
fireEvent(String event,
Object new_value,
Object old_value)
INTERNAL: Fires an event, so that listeners can be informed about
the event.
|
Collection<AssociationIF> |
getAssociations()
PUBLIC: Gets all associations in this topic map.
|
TopicMapBuilderIF |
getBuilder()
PUBLIC: Gets a topic map builder for use with this transaction.
|
Object |
getIndex(String name)
PUBLIC: Gets an index by name.
|
TMObjectIF |
getObjectById(String object_id)
PUBLIC: Gets the topic map object that has the given object
id, from this topic map.
|
TMObjectIF |
getObjectByItemIdentifier(LocatorIF locator)
PUBLIC: Gets the topic map object that has the given item
identifier (given as a LocatorIF object), from this topic map.
|
TopicIF |
getReifier()
PUBLIC: Returns the topic that reifies this object.
|
TopicMapStoreIF |
getStore()
PUBLIC: Gets the store to which the topic map's transaction is
connected.
|
protected SubjectIdentityCache |
getSubjectIdentityCache() |
TopicIF |
getTopicBySubjectIdentifier(LocatorIF locator)
PUBLIC: Gets the topic that has the specified subject identifier,
given as a locator.
|
TopicIF |
getTopicBySubjectLocator(LocatorIF locator)
PUBLIC: Gets the topic in this topic map that represents the
given addressable subject (locator given as a LocatorIF object).
|
TopicMapIF |
getTopicMap()
PUBLIC: Gets the topic map that this object belongs to.
|
Collection<TopicIF> |
getTopics()
PUBLIC: Gets all topics in this topic map.
|
TopicMapTransactionIF |
getTransaction() |
void |
processEvent(Object object,
String event,
Object new_value,
Object old_value)
INTERNAL: A method that receives notification when an event has been triggered.
|
void |
remove()
PUBLIC: Removes the object from its parent.
|
void |
removeAssociation(AssociationIF _association)
Removes an associations from the set of associations.
|
void |
removeListener(EventListenerIF listener,
String event)
INTERNAL: Unregister the listener as a listener for the event.
|
void |
removeTopic(TopicIF _topic)
Removes a topic from the set of topics.
|
void |
setReifier(TopicIF _reifier)
PUBLIC: Sets the reifier of this object.
|
protected void |
setSubjectIdentityCache(SubjectIdentityCache sicache) |
String |
toString() |
addItemIdentifier, getItemIdentifiers, getObjectId, isConnected, isReadOnly, removeItemIdentifier
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addItemIdentifier, getItemIdentifiers, getObjectId, isReadOnly, removeItemIdentifier
protected transient InMemoryTopicMapTransaction txn
protected transient CollectionFactoryIF cfactory
protected transient SubjectIdentityCache sicache
protected TopicIF reifier
protected Set<AssociationIF> assocs
protected Map<String,EventListenerIF[]> listeners
public TopicMapIF getTopicMap()
TMObjectIF
getTopicMap
in interface TMObjectIF
getTopicMap
in class TMObject
public TopicMapStoreIF getStore()
TopicMapIF
getStore
in interface TopicMapIF
public TopicMapTransactionIF getTransaction()
public TopicMapBuilderIF getBuilder()
TopicMapIF
getBuilder
in interface TopicMapIF
public Object getIndex(String name)
TopicMapIF
getIndex
in interface TopicMapIF
name
- A string; the index name, i.e.g the interface that it
implements.protected SubjectIdentityCache getSubjectIdentityCache()
protected void setSubjectIdentityCache(SubjectIdentityCache sicache)
public Collection<TopicIF> getTopics()
TopicMapIF
getTopics
in interface TopicMapIF
public void addTopic(TopicIF _topic)
public void removeTopic(TopicIF _topic)
public Collection<AssociationIF> getAssociations()
TopicMapIF
getAssociations
in interface TopicMapIF
public void addAssociation(AssociationIF _association)
public void removeAssociation(AssociationIF _association)
public void remove()
TMObjectIF
remove
in interface TMObjectIF
public void clear()
TopicMapIF
clear
in interface TopicMapIF
public TMObjectIF getObjectById(String object_id)
TopicMapIF
getObjectById
in interface TopicMapIF
object_id
- A string; the object id of the object to get.public TMObjectIF getObjectByItemIdentifier(LocatorIF locator)
TopicMapIF
getObjectByItemIdentifier
in interface TopicMapIF
locator
- The given locator; an object implementing LocatorIF.public TopicIF getTopicBySubjectLocator(LocatorIF locator)
TopicMapIF
getTopicBySubjectLocator
in interface TopicMapIF
locator
- The given locator; an object implementing LocatorIF.public TopicIF getTopicBySubjectIdentifier(LocatorIF locator)
TopicMapIF
getTopicBySubjectIdentifier
in interface TopicMapIF
locator
- The given locator; an object implementing LocatorIF.public TopicIF getReifier()
ReifiableIF
getReifier
in interface ReifiableIF
public void setReifier(TopicIF _reifier)
ReifiableIF
setReifier
in interface ReifiableIF
protected void fireEvent(String event, Object new_value, Object old_value)
TMObject
public void addListener(EventListenerIF listener, String event)
EventManagerIF
addListener
in interface EventManagerIF
public void removeListener(EventListenerIF listener, String event)
EventManagerIF
removeListener
in interface EventManagerIF
public void processEvent(Object object, String event, Object new_value, Object old_value)
EventListenerIF
processEvent
in interface EventListenerIF