ontopoly.model
Class Topic

java.lang.Object
  extended by ontopoly.model.Topic
Direct Known Subclasses:
AbstractTypingTopic, AssociationField, Cardinality, CreateAction, DataType, EditMode, FieldDefinition, FieldsView, InterfaceControl

public class Topic
extends java.lang.Object

INTERNAL: Common superclass for all topics, like instances, association types, topic types, role types, etc. FIXME: Should there be another subtype for isHidden, isReadOnly etc?


Constructor Summary
Topic(TopicIF topicIF, TopicMap tm)
          Constructor.
 
Method Summary
 void addTopicType(TopicType type)
          Adds the topic type to the list of topic types that topic is a direct instance of.
 Topic copyCharacteristics()
           
 boolean equals(java.lang.Object o)
           
protected  void findDependentObjects(java.util.Collection<Topic> alreadyKnownDependentObjects)
          Find all objects that are dependent on this topic and that should be removed if this topic is removed.
 java.util.Collection<Topic> getDependentObjects()
           
 java.util.List<FieldInstance> getFieldInstances(TopicType topicType)
           
 java.util.List<FieldInstance> getFieldInstances(TopicType topicType, FieldsView fieldsView)
           
 java.lang.String getId()
          Gets the id of this topic.
 TopicType getMostSpecificTopicType(TopicType topicType)
          Given the topic type, find the subtype that is the specific type of this topic.
 java.lang.String getName()
          Gets the unscoped name of the topic.
 TopicIF getTopicIF()
          Gets the topicIF object of this topic.
 TopicMap getTopicMap()
          Gets the topicMap this topic belongs to.
 java.util.List<TopicType> getTopicTypes()
          Returns the topic types of which this topic is a direct instance.
 int hashCode()
           
 boolean isAssociationType()
          Tests whether this topic is an association type.
 boolean isFieldDefinition()
          Tests whether this topic is a field definition or an association field.
 boolean isInstanceOf(LocatorIF psi)
           
 boolean isInstanceOf(Topic type)
           
 boolean isNameType()
          Tests whether this topic is a name type.
 boolean isOccurrenceType()
          Tests whether this topic is an occurrence type.
 boolean isOntologyTopic()
          Tests whether this topic is an instance of an ontology type, i.e.
 boolean isOntologyType()
          Tests whether this topic is an ontology type, i.e.
 boolean isPrivateSystemTopic()
           
 boolean isPublicSystemTopic()
           
 boolean isRoleType()
          Tests whether this topic is a role type.
 boolean isSystemTopic()
          Tests whether this topic is a system topic type.
 boolean isTopicMap()
          Tests whether this topic is a topic map.
 boolean isTopicType()
          Tests whether this topic is a topic type.
 void remove(LifeCycleListener listener)
          Removes the topic from the topic map.
 void removeTopicType(TopicType type)
          Removes the topic type from the list of topic types that topic is a direct instance of.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Topic

public Topic(TopicIF topicIF,
             TopicMap tm)
Constructor.

Parameters:
topicIF - the TopicIF object associated with this topic.
tm - the TopicMap this topic belongs to.
Method Detail

getId

public java.lang.String getId()
Gets the id of this topic.

Returns:
the id of this topic.

getTopicIF

public TopicIF getTopicIF()
Gets the topicIF object of this topic.

Returns:
the topicIF object of this topic.

getTopicMap

public TopicMap getTopicMap()
Gets the topicMap this topic belongs to.

Returns:
the topicMap this topic belongs to.

getName

public java.lang.String getName()
Gets the unscoped name of the topic.

Returns:
the unscoped name of the topic or null if no name has been set.

isTopicMap

public boolean isTopicMap()
Tests whether this topic is a topic map.

Returns:
true if this is a topic map.

isTopicType

public boolean isTopicType()
Tests whether this topic is a topic type.

Returns:
true if this is a topic type.

isNameType

public boolean isNameType()
Tests whether this topic is a name type.

Returns:
true if this is a name type.

isOccurrenceType

public boolean isOccurrenceType()
Tests whether this topic is an occurrence type.

Returns:
true if this is an occurrence type.

isAssociationType

public boolean isAssociationType()
Tests whether this topic is an association type.

Returns:
true if this is an association type.

isRoleType

public boolean isRoleType()
Tests whether this topic is a role type.

Returns:
true if this is a role type.

isFieldDefinition

public boolean isFieldDefinition()
Tests whether this topic is a field definition or an association field.

Returns:
true if this is a role type.

isSystemTopic

public boolean isSystemTopic()
Tests whether this topic is a system topic type.

Returns:
true if this is a system topic type.

isPrivateSystemTopic

public boolean isPrivateSystemTopic()

isPublicSystemTopic

public boolean isPublicSystemTopic()

isOntologyTopic

public boolean isOntologyTopic()
Tests whether this topic is an instance of an ontology type, i.e. an instance of topic type, name type, occurrence type, association type or role type.

Returns:
true if this is an instance of an ontology type.

isOntologyType

public boolean isOntologyType()
Tests whether this topic is an ontology type, i.e. topic type, name type, occurrence type, association type or role type.

Returns:
true if this is an ontology type.

getMostSpecificTopicType

public TopicType getMostSpecificTopicType(TopicType topicType)
Given the topic type, find the subtype that is the specific type of this topic. The topic type given is usually a super type of the specific type. If null is returned then the topic type is not a super type of this topic.

Parameters:
topicType - the super type of this topic
Returns:
the most specific type of this type, or null if there is none.

getTopicTypes

public java.util.List<TopicType> getTopicTypes()
Returns the topic types of which this topic is a direct instance.


addTopicType

public void addTopicType(TopicType type)
Adds the topic type to the list of topic types that topic is a direct instance of.


removeTopicType

public void removeTopicType(TopicType type)
Removes the topic type from the list of topic types that topic is a direct instance of.


getFieldInstances

public java.util.List<FieldInstance> getFieldInstances(TopicType topicType)

getFieldInstances

public java.util.List<FieldInstance> getFieldInstances(TopicType topicType,
                                                       FieldsView fieldsView)

remove

public void remove(LifeCycleListener listener)
Removes the topic from the topic map.

Parameters:
listener - listener that gets call back from the deleting this topic, and any dependencies.p

getDependentObjects

public java.util.Collection<Topic> getDependentObjects()

findDependentObjects

protected void findDependentObjects(java.util.Collection<Topic> alreadyKnownDependentObjects)
Find all objects that are dependent on this topic and that should be removed if this topic is removed. At the moment a dependent object is an object that is associated to this topic through a role field that has on:create-only-mode enabled. The dependencies are transitive.


equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

copyCharacteristics

public Topic copyCharacteristics()

isInstanceOf

public boolean isInstanceOf(Topic type)

isInstanceOf

public boolean isInstanceOf(LocatorIF psi)


Copyright © 2000-2012 Ontopia.