net.ontopia.topicmaps.schema.impl.osl
Class TopicRoleConstraint

java.lang.Object
  extended by net.ontopia.topicmaps.schema.impl.osl.AbstractCardinalityConstraint
      extended by net.ontopia.topicmaps.schema.impl.osl.AbstractScopedCardinalityConstraint
          extended by net.ontopia.topicmaps.schema.impl.osl.AbstractScopedTypedCardinalityConstraint
              extended by net.ontopia.topicmaps.schema.impl.osl.TopicRoleConstraint
All Implemented Interfaces:
CardinalityConstraintIF, ConstraintIF, ScopedConstraintIF, TypedConstraintIF

public class TopicRoleConstraint
extends AbstractScopedTypedCardinalityConstraint

INTERNAL: Represents a constraint on the allowed association roles of the instances of a topic class.


Field Summary
protected  java.util.Collection assoctypes
           
protected  TopicConstraintCollection parent
           
 
Fields inherited from class net.ontopia.topicmaps.schema.impl.osl.AbstractScopedTypedCardinalityConstraint
typespec
 
Fields inherited from class net.ontopia.topicmaps.schema.impl.osl.AbstractScopedCardinalityConstraint
scope
 
Fields inherited from class net.ontopia.topicmaps.schema.impl.osl.AbstractCardinalityConstraint
maximum, minimum
 
Fields inherited from interface net.ontopia.topicmaps.schema.core.CardinalityConstraintIF
INFINITY
 
Constructor Summary
TopicRoleConstraint(TopicConstraintCollection parent)
          PUBLIC: Creates a new topic role constraint belonging to the given collection.
 
Method Summary
 void addAssociationType(TypeSpecification typespec)
          PUBLIC: Adds an allowed association type.
 java.util.Collection getAssociationTypes()
          PUBLIC: Returns the set of allowed types of associations in which this instances of this role may participate.
 boolean matches(TMObjectIF object)
          PUBLIC: Returns true if the object given is constrained by this constraint.
 void removeAssociationType(TypeSpecification typespec)
          PUBLIC: Removes an allowed association type.
 
Methods inherited from class net.ontopia.topicmaps.schema.impl.osl.AbstractScopedTypedCardinalityConstraint
getTypeSpecification, setTypeSpecification
 
Methods inherited from class net.ontopia.topicmaps.schema.impl.osl.AbstractScopedCardinalityConstraint
getScopeSpecification, setScopeSpecification
 
Methods inherited from class net.ontopia.topicmaps.schema.impl.osl.AbstractCardinalityConstraint
getMaximum, getMinimum, setMaximum, setMinimum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected TopicConstraintCollection parent

assoctypes

protected java.util.Collection assoctypes
Constructor Detail

TopicRoleConstraint

public TopicRoleConstraint(TopicConstraintCollection parent)
PUBLIC: Creates a new topic role constraint belonging to the given collection.

Method Detail

getAssociationTypes

public java.util.Collection getAssociationTypes()
PUBLIC: Returns the set of allowed types of associations in which this instances of this role may participate.

Returns:
A collection of TypeSpecification objects.

removeAssociationType

public void removeAssociationType(TypeSpecification typespec)
PUBLIC: Removes an allowed association type.


addAssociationType

public void addAssociationType(TypeSpecification typespec)
PUBLIC: Adds an allowed association type.


matches

public boolean matches(TMObjectIF object)
Description copied from interface: ConstraintIF
PUBLIC: Returns true if the object given is constrained by this constraint.

Specified by:
matches in interface ConstraintIF
Overrides:
matches in class AbstractScopedTypedCardinalityConstraint


Copyright © 2000-2012 Ontopia.