Package ontopoly.model
Class Topic
- java.lang.Object
-
- ontopoly.model.Topic
-
- Direct Known Subclasses:
AbstractTypingTopic,AssociationField,Cardinality,CreateAction,DataType,EditMode,FieldDefinition,FieldsView,InterfaceControl
public class Topic extends 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?
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTopicType(TopicType type)Adds the topic type to the list of topic types that topic is a direct instance of.TopiccopyCharacteristics()booleanequals(Object o)protected voidfindDependentObjects(Collection<Topic> alreadyKnownDependentObjects)Find all objects that are dependent on this topic and that should be removed if this topic is removed.Collection<Topic>getDependentObjects()List<FieldInstance>getFieldInstances(TopicType topicType)List<FieldInstance>getFieldInstances(TopicType topicType, FieldsView fieldsView)StringgetId()Gets the id of this topic.TopicTypegetMostSpecificTopicType(TopicType topicType)Given the topic type, find the subtype that is the specific type of this topic.StringgetName()Gets the unscoped name of the topic.TopicIFgetTopicIF()Gets the topicIF object of this topic.TopicMapgetTopicMap()Gets the topicMap this topic belongs to.List<TopicType>getTopicTypes()Returns the topic types of which this topic is a direct instance.inthashCode()booleanisAssociationType()Tests whether this topic is an association type.booleanisFieldDefinition()Tests whether this topic is a field definition or an association field.booleanisInstanceOf(LocatorIF psi)booleanisInstanceOf(Topic type)booleanisNameType()Tests whether this topic is a name type.booleanisOccurrenceType()Tests whether this topic is an occurrence type.booleanisOntologyTopic()Tests whether this topic is an instance of an ontology type, i.e.booleanisOntologyType()Tests whether this topic is an ontology type, i.e.booleanisPrivateSystemTopic()booleanisPublicSystemTopic()booleanisRoleType()Tests whether this topic is a role type.booleanisSystemTopic()Tests whether this topic is a system topic type.booleanisTopicMap()Tests whether this topic is a topic map.booleanisTopicType()Tests whether this topic is a topic type.voidremove(LifeCycleListener listener)Removes the topic from the topic map.voidremoveTopicType(TopicType type)Removes the topic type from the list of topic types that topic is a direct instance of.StringtoString()
-
-
-
Method Detail
-
getId
public 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 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 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 List<FieldInstance> getFieldInstances(TopicType topicType)
-
getFieldInstances
public 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 Collection<Topic> getDependentObjects()
-
findDependentObjects
protected void findDependentObjects(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.
-
copyCharacteristics
public Topic copyCharacteristics()
-
isInstanceOf
public boolean isInstanceOf(Topic type)
-
isInstanceOf
public boolean isInstanceOf(LocatorIF psi)
-
-