ontopoly.model
Class RoleField

java.lang.Object
  extended by ontopoly.model.Topic
      extended by ontopoly.model.FieldDefinition
          extended by ontopoly.model.RoleField

public class RoleField
extends FieldDefinition

Represents a role field.


Nested Class Summary
static interface RoleField.ValueIF
          Interface.
 
Field Summary
 
Fields inherited from class ontopoly.model.FieldDefinition
FIELD_TYPE_IDENTITY, FIELD_TYPE_NAME, FIELD_TYPE_OCCURRENCE, FIELD_TYPE_QUERY, FIELD_TYPE_ROLE
 
Constructor Summary
RoleField(TopicIF topic, TopicMap tm)
           
RoleField(TopicIF topic, TopicMap tm, RoleType roleType, AssociationField associationField)
           
 
Method Summary
 void addValue(Topic topic, java.lang.Object _value, LifeCycleListener listener)
          Adds an instance topic to the other side of an association an instance topic takes part in.
static RoleField.ValueIF createValue(int arity)
          Factory method for creating a ValueIF object, which represent an instance topic on one side of an association.
 boolean equals(java.lang.Object obj)
           
 java.util.List<Topic> getAllowedPlayers()
           
 java.util.List<Topic> getAllowedPlayers(Topic currentTopic)
           
 java.util.Collection<TopicType> getAllowedPlayerTypes(Topic currentTopic)
           
 AssociationField getAssociationField()
           
 AssociationType getAssociationType()
          Gets the association type.
 CreateAction getCreateAction()
           
 java.util.Collection<TopicType> getDeclaredPlayerTypes()
          Gets the topic types that have been declared as valid and which may play the other roles in this association type.
 EditMode getEditMode()
           
 java.lang.String getFieldName()
          Returns the name of this field definition.
 java.util.Collection<RoleField> getFieldsForOtherRoles()
          Gets the other RoleField objects this object's association type topic takes part in.
 int getFieldType()
           
 InterfaceControl getInterfaceControl()
          Gets the interface control assigned for this association field.
 LocatorIF getLocator()
           
 java.util.List<RoleField.ValueIF> getOrderedValues(Topic topic, RoleField ofield)
           
 java.util.Collection<RoleField> getOtherRoleFields()
           
 RoleType getRoleType()
          Gets the role type.
 java.util.List<RoleField.ValueIF> getValues(Topic topic)
          Gets the instance topics on the other side of an association an instance topic takes part in.
 boolean isSortable()
           
 void moveAfter(Topic instance, RoleField ofield, RoleField.ValueIF rfv1, RoleField.ValueIF rfv2)
          Change field value order so that the first value is ordered directly after the second value.
 void removeValue(Topic topic, java.lang.Object _value, LifeCycleListener listener)
          Removes an instance topic from the other side of an association an instance topic takes part in.
 java.util.List<Topic> searchAllowedPlayers(java.lang.String searchTerm)
          Search for the topics that match the given search term.
 
Methods inherited from class ontopoly.model.FieldDefinition
getCardinality, getFieldDefinition, getFieldDefinition, getFieldDefinition, getValidationType, getValueView, getViewModes, hashCode, setCardinality
 
Methods inherited from class ontopoly.model.Topic
addTopicType, copyCharacteristics, findDependentObjects, getDependentObjects, getFieldInstances, getFieldInstances, getId, getMostSpecificTopicType, getName, getTopicIF, getTopicMap, getTopicTypes, isAssociationType, isFieldDefinition, isInstanceOf, isInstanceOf, isNameType, isOccurrenceType, isOntologyTopic, isOntologyType, isPrivateSystemTopic, isPublicSystemTopic, isRoleType, isSystemTopic, isTopicMap, isTopicType, remove, removeTopicType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoleField

public RoleField(TopicIF topic,
                 TopicMap tm)

RoleField

public RoleField(TopicIF topic,
                 TopicMap tm,
                 RoleType roleType,
                 AssociationField associationField)
Method Detail

getFieldType

public int getFieldType()
Specified by:
getFieldType in class FieldDefinition
Returns:
an int that identifies this fieldType

getFieldName

public java.lang.String getFieldName()
Description copied from class: FieldDefinition
Returns the name of this field definition.

Specified by:
getFieldName in class FieldDefinition

getLocator

public LocatorIF getLocator()
Specified by:
getLocator in class FieldDefinition

equals

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

isSortable

public boolean isSortable()

getEditMode

public EditMode getEditMode()

getCreateAction

public CreateAction getCreateAction()

getAssociationType

public AssociationType getAssociationType()
Gets the association type.

Returns:
the association type.

getRoleType

public RoleType getRoleType()
Gets the role type.

Returns:
the role type.

getAssociationField

public AssociationField getAssociationField()

getFieldsForOtherRoles

public java.util.Collection<RoleField> getFieldsForOtherRoles()
Gets the other RoleField objects this object's association type topic takes part in.

Returns:
the other RoleField objects this object's association type topic takes part in.

getInterfaceControl

public InterfaceControl getInterfaceControl()
Gets the interface control assigned for this association field. If no interface control object is assigned, the method will return the default interface control, which is drop-down-list.

Returns:
the interface control assigned to this association field.

getDeclaredPlayerTypes

public java.util.Collection<TopicType> getDeclaredPlayerTypes()
Gets the topic types that have been declared as valid and which may play the other roles in this association type.

Returns:
the topic types which may play the other roles in this association type.

getAllowedPlayerTypes

public java.util.Collection<TopicType> getAllowedPlayerTypes(Topic currentTopic)

getAllowedPlayers

public java.util.List<Topic> getAllowedPlayers()

getAllowedPlayers

public java.util.List<Topic> getAllowedPlayers(Topic currentTopic)

searchAllowedPlayers

public java.util.List<Topic> searchAllowedPlayers(java.lang.String searchTerm)
Search for the topics that match the given search term. Only topics of allowed player types are returned.

Parameters:
searchTerm - the search term used to search for topics.
Returns:
a collection of Topic objects

getValues

public java.util.List<RoleField.ValueIF> getValues(Topic topic)
Gets the instance topics on the other side of an association an instance topic takes part in.

Specified by:
getValues in class FieldDefinition
Parameters:
topic - the instance topic that takes part in the association.
Returns:
the instance topics on the other side of an association an instance topic takes part in.

getOrderedValues

public java.util.List<RoleField.ValueIF> getOrderedValues(Topic topic,
                                                          RoleField ofield)

addValue

public void addValue(Topic topic,
                     java.lang.Object _value,
                     LifeCycleListener listener)
Adds an instance topic to the other side of an association an instance topic takes part in.

Specified by:
addValue in class FieldDefinition
Parameters:
topic - the instance topic that takes part in the association.
_value - an object representing the instance topic that will be added to the other side of the association the instance topic (topic) takes part in.

removeValue

public void removeValue(Topic topic,
                        java.lang.Object _value,
                        LifeCycleListener listener)
Removes an instance topic from the other side of an association an instance topic takes part in.

Specified by:
removeValue in class FieldDefinition
Parameters:
_value - an object representing the instance topic that will be removed from the other side of the association the instance topic (topic) takes part in.

createValue

public static RoleField.ValueIF createValue(int arity)
Factory method for creating a ValueIF object, which represent an instance topic on one side of an association.

Parameters:
arity - the number of players that the association value should have.
Returns:
the ValueIF object that represent an instance topic on one side of an association.

moveAfter

public void moveAfter(Topic instance,
                      RoleField ofield,
                      RoleField.ValueIF rfv1,
                      RoleField.ValueIF rfv2)
Change field value order so that the first value is ordered directly after the second value.


getOtherRoleFields

public java.util.Collection<RoleField> getOtherRoleFields()


Copyright © 2000-2012 Ontopia.